[metapost] Passing macro as macro's argument

Hartmut Henkel hartmut_henkel at gmx.de
Sat Jun 16 10:35:26 CEST 2007


On Fri, 15 Jun 2007, Peng Yu wrote:

> I want to pass macro as another macro's argument. But it doesn't work.
> Would you please let me know if it is possible?

> vardef g(expr f, x) =
>   f(x)
> enddef;
>
> show g(sind, 0);

vardef g(expr f, x) =
  scantokens f(x)
enddef;

show g("sind", 30) + 0.2;

Regards, Hartmut


More information about the metapost mailing list