[metapost] Convert string to variable name

Troy Henderson thenders at gmail.com
Tue Jun 28 22:13:59 CEST 2011


I would like to reference variables in the following way:

numeric a,b,ab;
string foo,bar,boo;
a:=1;
b:=2;
ab:=17;
foo:="a";
bar:="b";
boo:=foo & bar;

Now clearly I can retrieve the value of a,b, and ab by

show a;
show b;
show ab;

but I would like to know how I might retrieve these values using the
variables foo, bar, and boo.

Troy


More information about the metapost mailing list