Taco Hoekwater wrote:
> 
> Aditya Mahajan wrote:
>> Notice the first line of \ascii, and compare that with the definition of
>> \doifelse. The command \!!stringa inside the definition of \doifelse gets
>> expanded too soon. Is there any way to get this work, other than doing the
>> comparison outside the MP code.
> 
> Not with \doifelse. If the control sequences are as simple as in the
> example, you could do the comparison in MP code:
> 
>    def doifelse (expr a, b)(text c)(text d) =
>      if a=b: c else: d fi
>    enddef;
>    draw doifelse("test")("string")(fullcircle)(fullsquare) scaled 5cm ;

alternatively, in mkiv there is a fully expandable \expdoifelse but at 
the cost of lua call (\doifelse uses intermediate macros which is why it 
is not fully expandable)

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to