-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Josef Vukovic on 11/29/2009 8:08 PM: > Hello, > > Can I stop the expansion of a marco after it has been expanded? > > for example: > > define(foo,bar) > define(foo,baz)
At this point: defn(`foo') => bar defn(`bar') => baz If, on the other hand, you do: define(`foo', bar) define(`foo', baz) defn(`foo') => baz defn(`bar') => that is, bar remains undefined. This very problem of defining an unintended macro name if you forget to use proper quoting is why it is almost always a good idea to quote the first argument to define. Thus, defn is a way to get at the contents of a defined macro without further expansion. Also, if you wait for me to ever get enough time to release m4 1.6 (or, if you build from git), you can play with the new builtin qindir, which is similar to defn in that it can show quoted contents of a macro definition, but different in that it also performs $1 substitution more like a regular macro expansion. - -- Don't work too hard, make some time for fun as well! Eric Blake [email protected] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAksTyWgACgkQ84KuGfSFAYCCwQCgkp+ridvzJBpUXAq2T5ecg5yy 3iQAnRjpxI9ep+BhNww5eRTf9ys2wYqj =A14x -----END PGP SIGNATURE-----
