[metapost] accessing variables in nested macros

Piotr Zielinski piotr.zielinski at gmail.com
Sat Feb 10 18:27:47 CET 2007


On 10/02/07, Stephan Hennig <mailing_list at arcor.de> wrote:
> One additional observation: At least, arguments seem to be evaluated
> before substitution and operations involving a parameter are magically
> chosen sensibly.  [...] > How is the implicit binary operation
> (multiplication) preserved when "a" isn't a variable with a known type
> (numeric)?

I'm not sure here.  Yes, if you use "expr", then "a" is evaluated
before the function is executed, and the result of this evaluation is
substituted for all occurrences of "a".  Judging from MetaPost error
messages, the evaluated parameters are known as (EXPR0), (EXPR1), etc.
The term "textual substitution" is probably not good here, "token
substitution" is better.  Again, I'm not sure here.

Piotr


More information about the metapost mailing list