I have this vardef:

vardef Foo(expr w, h) =
   save pth; path pth;
   %save pth2; path pth2;
   save pic; picture pic;
   pth = fullsquare xysized (w, h);
   %pth2 = fullsquare xysized (h/4, h/8)
   pic := image (
       draw pth;
       %draw pth2 shifted (-w/2, -h/4);
       % all kind of stuff here
   );
   setbounds pic to pth;
   pic
enddef ;

As soon as I uncomment the bold line (first comment) a mtxrun fails. Whatever I try, a single save statement, etc., I fail in getting a second local variable. The METAPOST manual is no help.

The error shown is:

metapost log    > ! Extra tokens will be flushed.
metapost log    > <to be read again> 
metapost log    >                    2
metapost log    > Foo->...h;path.pth;save.pth2
metapost log    >                                                   ;path.pth2;save.pic;pictur...
metapost log    > <*> ... ; s := Foo(8cm, 2cm)
metapost log    >                                                   ; draw s; drawdot center l...
metapost log    > 

Why?

G