[metapost] Bug with the binary operator `point ... on ...` from Metafun

Franck Pastor franck.pastor at me.com
Mon Mar 9 17:01:37 CET 2015

I’ve just encountered a very puzzling bug with the binary operator `point <len> of <path>` defined in the Metafun format.

In the Metafun manual (http://www.pragma-ade.com/general/manuals/metafun-p.pdf), p. 61, this binary operator is defined as such:

primarydef len of pat =
  (arctime len of pat) of pat

So if I write `point 0 on pat`, it should return the starting point of the path <pat>, right? But n. To the contrary, it returns the end point of <pat>! Stranger yet, if I try `point (arctime 0 of pat) of pat`, it returns the starting point, as expected. 

This weird behavior is illustrated by the following program, to be run with the Metafun format of course:

path line[]; line1 = origin -- 3cm*right; line2 = line1 yshifted -1cm;
draw line1; draw line2;
pickup pencircle scaled 3bp;
draw point 0 of line1; % draw a dot at the start point, as expected
draw point 0 on line1; % draws a dot at the end point!!!!!
draw point (arctime 0 of line2) of line2; % draws a dot at the starting point…

An idea about what is wrong? 

I use MetaPost 1.902 and Metafun version 1.004, from TeX Live 2014.

Thanks in advance,

Franck Pastor

More information about the metapost mailing list