* MPdefinitions
@ 2011-05-23 10:02 Vedran Miletić
2011-05-23 10:45 ` MPdefinitions Wolfgang Schuster
0 siblings, 1 reply; 5+ messages in thread
From: Vedran Miletić @ 2011-05-23 10:02 UTC (permalink / raw)
To: NTG-ConTeXt mailing list
[-- Attachment #1.1: Type: text/plain, Size: 938 bytes --]
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_labels>0:
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
[-- Attachment #1.2: Type: text/html, Size: 1274 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: MPdefinitions
2011-05-23 10:02 MPdefinitions Vedran Miletić
@ 2011-05-23 10:45 ` Wolfgang Schuster
2011-05-23 15:37 ` MPdefinitions Vedran Miletić
0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2011-05-23 10:45 UTC (permalink / raw)
To: mailing list for ConTeXt users
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_labels>0:
> 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: MPdefinitions
2011-05-23 10:45 ` MPdefinitions Wolfgang Schuster
@ 2011-05-23 15:37 ` Vedran Miletić
2011-05-23 16:23 ` MPdefinitions Wolfgang Schuster
0 siblings, 1 reply; 5+ messages in thread
From: Vedran Miletić @ 2011-05-23 15:37 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1448 bytes --]
2011/5/23 Wolfgang Schuster <schuster.wolfgang@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_labels>0:
draw_problem_labels ;
fi;
endgroup ;
enddef ;
\stopMPdefinitions
\starttext
Hello.
\stoptext
Result is the same.
Vedran
[-- Attachment #1.2: Type: text/html, Size: 2045 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: MPdefinitions
2011-05-23 15:37 ` MPdefinitions Vedran Miletić
@ 2011-05-23 16:23 ` Wolfgang Schuster
2011-05-23 16:57 ` MPdefinitions Vedran Miletić
0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2011-05-23 16:23 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 411 bytes --]
Am 23.05.2011 um 17:37 schrieb Vedran Miletić:
> 2011/5/23 Wolfgang Schuster <schuster.wolfgang@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
[-- Attachment #1.2: Type: text/html, Size: 1067 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: MPdefinitions
2011-05-23 16:23 ` MPdefinitions Wolfgang Schuster
@ 2011-05-23 16:57 ` Vedran Miletić
0 siblings, 0 replies; 5+ messages in thread
From: Vedran Miletić @ 2011-05-23 16:57 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 623 bytes --]
2011/5/23 Wolfgang Schuster <schuster.wolfgang@googlemail.com>
>
> Am 23.05.2011 um 17:37 schrieb Vedran Miletić:
>
> 2011/5/23 Wolfgang Schuster <schuster.wolfgang@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
[-- Attachment #1.2: Type: text/html, Size: 1404 bytes --]
[-- Attachment #2: solvers.tex --]
[-- Type: application/x-tex, Size: 1514 bytes --]
[-- Attachment #3: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-05-23 16:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-23 10:02 MPdefinitions Vedran Miletić
2011-05-23 10:45 ` MPdefinitions Wolfgang Schuster
2011-05-23 15:37 ` MPdefinitions Vedran Miletić
2011-05-23 16:23 ` MPdefinitions Wolfgang Schuster
2011-05-23 16:57 ` MPdefinitions Vedran Miletić
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).