gnum4

GNU M4: expand bracketed text?


If I run:

define(`[x]`,`y')
[x]
=>[x]

Nothing happens.. Is there a way to expand brackets in M4?


Solution

  • If the name of the macro that you have defined contains non-alphanumeric characters the only way to expand its content is by using the defn() built-in macro:

    define(`[x]',`y')
    defn(`[x]')
    => y