m4-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it possible to expand macro just once?


From: Wolf
Subject: Re: Is it possible to expand macro just once?
Date: Tue, 13 Oct 2020 22:58:03 +0200

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.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]