[NTG-context] MPdefinitions

2011-05-23 Thread Vedran Miletić
Hi,

compiling example with quadriliterals and \startMPdefinitions{solvers}
\stopMPdefinitions from MetaFun manual, regardless of the code that is
commented out inside MPdefintions environment, gives:

! You can't use `\relax' after \the.

system   tex  error on line 30 in file solvers.tex: You can't use
` ...

20 %  z1=0.5[z11,z13] ; z2=0.5[z21,z23] ;
21 %  z3=0.5[z31,z33] ; z4=0.5[z41,z43] ;
22 %  draw z1--z3 dashed evenly ; draw z2--z4 dashed evenly ;
23 %  z0=whatever[z1,z3]=whatever[z2,z4] ;
24 %  mark_rt_angle (z1,z0,z2);
25 %  if show_labels0:
26 %  draw_problem_labels ;
27 %  fi;
28 %  endgroup ;
29 %  enddef ;
30   \stopMPdefinitions
31
32 \starttext
33 %a
34 \stoptext

recently read \@MPF@::solvers

\dostartMPdefinitions ...er {\the \MPinstancetoks
  #2}
l.30 \stopMPdefinitions

Is this a bug?

Vedran
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MPdefinitions

2011-05-23 Thread Wolfgang Schuster

Am 23.05.2011 um 12:02 schrieb Vedran Miletić:

 Hi,
 
 compiling example with quadriliterals and \startMPdefinitions{solvers} 
 \stopMPdefinitions from MetaFun manual, regardless of the code that is 
 commented out inside MPdefintions environment, gives:
 
 ! You can't use `\relax' after \the.
 
 system   tex  error on line 30 in file solvers.tex: You can't use ` 
 ...
 
 20 %  z1=0.5[z11,z13] ; z2=0.5[z21,z23] ;
 21 %  z3=0.5[z31,z33] ; z4=0.5[z41,z43] ;
 22 %  draw z1--z3 dashed evenly ; draw z2--z4 dashed evenly ;
 23 %  z0=whatever[z1,z3]=whatever[z2,z4] ;
 24 %  mark_rt_angle (z1,z0,z2);
 25 %  if show_labels0:
 26 %  draw_problem_labels ;
 27 %  fi;
 28 %  endgroup ;
 29 %  enddef ;
 30   \stopMPdefinitions
 31 
 32 \starttext
 33 %a
 34 \stoptext
 
 recently read \@MPF@::solvers 
 
 \dostartMPdefinitions ...er {\the \MPinstancetoks 
   #2}
 l.30 \stopMPdefinitions
 
 Is this a bug?

Please send a complete example!

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MPdefinitions

2011-05-23 Thread Vedran Miletić
2011/5/23 Wolfgang Schuster schuster.wolfg...@googlemail.com

 Please send a complete example!


Sure:

\startMPdefinitions{solvers}
\stopMPdefinitions

\starttext
Hello.
\stoptext
or this:

\startMPdefinitions{solvers}
def draw_problem (expr p, q, r, s, show_lables)=
begingroup ; save x, y, a, b, c, d, e, f, g, h ;
z11=z42=p ; z21=z12=q ; z31=z22=r ; z41=z32=s ;
a=x12-x11 ; b=y12-y11 ; c=x22-x21 ; d=y22-y21 ;
e=x32-x31 ; f=y32-y31 ; g=x42-x41 ; h=y42-y41 ;
z11=(x11, y11) ; z12=(x12, y12) ;
z13=(x12-b, y12+a) ; z14=(x11-b, y11+a) ;
z21=(x21, y21) ; z22= (x22, y22);
z23=(x22-s,y22+c) ; z24=(x21-d, y21+c) ;
z31=(x31, y31) ; z32=(x32, y32) ;
z33=(x32-f, y32+e) ; z34=(x31-f, y31+e);
z41=(x41, y41) ; z42=(x42, y42) ;
z43=(x42-h,y42+g) ; z44=(x41-h,y41+g) ;
pickup pencircle scaled .5pt ;
draw z11--z12--z13--z14--cycle ; draw z11--z13 ; draw z12--z14 ;
draw z21--z22--z23--z24--cycle ; draw z21—z23 ; draw z22—z24 ;
draw z31--z32--z33--z34--cycle ; draw z31—z33 ; draw z32—z34 ;
draw z41--z42--z43--z44--cycle ; draw z41—z43 ; draw z42—z44 ;
z1=0.5[z11,z13] ; z2=0.5[z21,z23] ;
z3=0.5[z31,z33] ; z4=0.5[z41,z43] ;
draw z1--z3 dashed evenly ; draw z2--z4 dashed evenly ;
z0=whatever[z1,z3]=whatever[z2,z4] ;
mark_rt_angle (z1,z0,z2);
if show_labels0:
draw_problem_labels ;
fi;
endgroup ;
enddef ;
\stopMPdefinitions

\starttext
Hello.
\stoptext

Result is the same.

Vedran
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MPdefinitions

2011-05-23 Thread Wolfgang Schuster

Am 23.05.2011 um 17:37 schrieb Vedran Miletić:

 2011/5/23 Wolfgang Schuster schuster.wolfg...@googlemail.com
 Please send a complete example!
 
 Sure:
 
 […]

Add

\defineMPinstance
  [solvers]
  [format=metafun,
   extensions=yes,
   initializations=yes]

before \startMPdefintions or omit the argument (i.e. “{solvers}”)
from the \startMPdefintions command.

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] MPdefinitions

2011-05-23 Thread Vedran Miletić
2011/5/23 Wolfgang Schuster schuster.wolfg...@googlemail.com


 Am 23.05.2011 um 17:37 schrieb Vedran Miletić:

 2011/5/23 Wolfgang Schuster schuster.wolfg...@googlemail.com

 Please send a complete example!


 Sure:

 […]


 Add

 \defineMPinstance
   [solvers]
   [format=metafun,
extensions=yes,
initializations=yes]

 before \startMPdefintions or omit the argument (i.e. “{solvers}”)
 from the \startMPdefintions command.


Great, thanks.

Why does the code in attachment then produce undefined? It's an example
from MetaFun book.

Vedran


solvers.tex
Description: TeX document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___