2010/12/5 Alan BRASLAU
Hello,
You should change all of the "=" to ":=", as in u := 1cm;
This instructs metapost to assign a value to the variable; the standard form "u = 1cm" is a formula for metapost to solve. It tries then to resolve u = 1cm; xmin = -2.6u; and xmax = 4u; as a coupled set of equations. Sometimes you can get away with this but in general one should use the := (assignment) form.
Consider, for example: u = u + 1; (a standard programming statement but nonsense for a mathematician).
I know the difference between "=" and ":=". But that example shows the metafun in MkIV is abnormal since it can be compiled rightly in MkII, which should not have any syntax error. In fact, the following example can be compiled rightly in MkIV. \starttext \startMPcode save u, xmin, xmax; u = 1cm; xmin = -2.6u; xmax = 4u; drawarrow (xmin,0)--(xmax,0); label.lft("hello",(0, 0)); \stopMPcode \stoptext -- Best regards, Li Yanrui (李延瑞)