[metapost] Error on using implicit suffix parameter (mpost 1.504)

Nicola nvitacolonna at gmail.com
Tue Sep 13 12:53:51 CEST 2011


Hi,
feeding mpost 1.504 (from TeX Live 2011) with the following code

vardef XYZ.test =
   for i = incr(#@) downto 0 : message decimal(i); endfor
enddef;
XYZ = 5;
XYZ.test;

results in

! A statement can't begin with `:='.
<to be read again> 
                   :=
downto->begingroup(SUFFIX2):=
                             (SUFFIX2)+1;(SUFFIX2)endgroup
<to be read again> 
                   step
downto->step
            -1until
implicit_suffix_param->....i=incr((SUFFIX0))downto
                                                  0:message.decimal(i);endfo...
l.12 XYZ.test
             ;
? 

I'm pretty sure that this used to work previously. Can anyone confirm and/or 
reproduce this? The bug only occurs under the following conditions:

- incr (or decr) is used in a for loop with upto or downto;
- incr/decr's argument is enclosed in parentheses.

Both incr #@ and (incr(#@)) are ok.

Nicola



More information about the metapost mailing list