[metapost] [solved] Re: Metapost doesn't like `z01' for point names
Rodolfo Medina
rodolfo.medina at gmail.com
Thu Jun 21 13:20:08 CEST 2007
On Sun, 17 Jun 2007, Rodolfo Medina wrote:
>> Please excuse the basic question.
>> If I name a point `z01' Metapost complains:
>>
>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> %file test.mp
>> beginfig(1);
>>
>> z0 = (0,0);
>> z1 = (1,1);
>>
>> z01 = 0.5[z0,z1];
>>
>> endfig;
>>
>> end
>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>
>> $ mpost test
>> This is MetaPost, Version 0.641 (Web2C 7.4.5)
>> (test.mp
>> ! Inconsistent equation (off by -0.5).
>> <to be read again>
>> ;
>> l.8 z01 = 0.5[z0,z1];
>>
>> ?
>>
>>
>> Instead, if I name it `z11' it's okay. Why? I really would like to name it
>> `z01': is it definitely impossible?
Hartmut Henkel <hartmut_henkel at gmx.de> writes:
> z01 == z1 == z[1] == e. g. z0001.0 due to MetaPost's token rules, see e.
> g. MFBook p. 50. And z1 was defined already. Numeric suffixes even
> include the decimal point, another example: z.0100 == z.01 == z[0.01].
Now it seems to work:
beginfig(1);
u=2cm;
z0 = (0,0) * u;
z1 = (1,1) * u;
z0_1 = 0.5[z0,z1];
draw z0..z0_1..z1;
endfig;
end
Thanks for the help,
Rodolfo
More information about the metapost
mailing list