Given this MWE (compiled under ConTeXt)
\starttext
\startMPpage
%variables
u:=1mm ;
numeric l[];
l[1]:=30 ;
l[2]:=70 ;
draw (0,0) -- (0,100u) ;
%this does not work
%fill unitsquare xscaled (l[2]-l[1])*u yscaled 100*u shifted (l[1]*u,0) withcolor red ;
%this does
fill unitsquare xscaled (l[2]*u-l[1]*u) yscaled 100u shifted (l[1]*u,0) withcolor red ;
\stopMPpage
\stoptext
Could you explain me why
fill unitsquare xscaled (l[2]-l[1])*u yscaled 100*u shifted (l[1]*u,0) withcolor red ;
fails, whereas
fill unitsquare xscaled (l[2]*u-l[1]*u) yscaled 100*u shifted (l[1]*u,0) withcolor red ;
does the job?
From my (not so good in maths) points of view, (l[2]-l[1])*u should be exactly the same, and this misunderstandings leads me often to frustrating errors.
I hope this is not a duplicate, but didn't know how to produce a proper title.
xscaled ((l[2]-l[1])*u)
?