Re: Is it possible to expand macro just once?

Wolf <[email protected]> Tue, 13 Oct 2020 22:58:03 +0200
Newsgroups gmane.comp.gnu.m4.general
Message-ID <[email protected]>
On 2020-10-12 07:24:22 -0500, Eric Blake wrote:
> 
> In general, if the user is providing you text rather than something that
> should expand as a macro that needs further recursive interpretation, you
> should use defn() to get at that text:
> 
> $ echo 'changequote([,])defn([foo])' | m4 -Dfoo=bar -Dbar=baz
> bar
> 
> But keep in mind that defn does NOT perform any interpolation of $, which
> may introduce its own oddities if the user supplied a macro definition
> containing $ that you aren't expanding as a macro.

This works great, thanks a lot :)

W.

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE7BIrb0FxyZaks1p7hTP5S2N55TgFAl+GFNoACgkQhTP5S2N5
5Th5Kg/+JOb3Vt5rFa/6hXk1bG/bH/Qs+ugvD6BCUQzT5xvH7D9TPoCfa3hff1yv
4T7CTm/zgIKqtFBYCRjrDm8Y16/0wxtSd38GaK7qDo0QtHRoTxUxolTK/+1FiRoE
SMZbS1H0+K3vdrI3OzxJher1JPaAXOG+siq04A4oeAQ1QUtKM4Yv5I4zNfbRyKww
m1OvUaRo3MRRYYxGbPXGQr48Xmux3Hzo5WKstRdi+kSjaMxvVN2VEEugalaJpKu2
Y87uj4jmvcIWa7x++pckvaduzeHoXmKoTeBpZyufQw18kNDKkUxMw5wNhNFEaj/t
zFWTNnbkFgkvhzCmVXmVIQ8WBfnV+cbW9JRVNKkW5esPYu6EjDuUbPdisK3JmCR9
4iBRgjiBnbpQXtMeopPzMBVB3pSYTXfqtRoO+g6F+KjwPZfa6ZUEpjpN02oiz7zC
4huoeH7SKfKlXIvNxFemkW+ojFKH+V9tCrED43C4jC+rvVjOAcVF6hlX2Gc/gZWS
TyO8AVFmR9Tk7swIUy5K5cjs/kd0BeH2EFJexzBs5bGm9+3DR4c39krTAQ+x1OqO
cNgpT3mPDEeFTY0mYszOnNLoLPDCCRQX6sfygrBrg6vU/Ato0szh+QkQ0BpM+5PK
MdsnnarRZbdU/99kpexzwtsbC45bur7s/keK84O2yEfzC6jEfdI=
=gqPB
-----END PGP SIGNATURE-----