On Tue, 18 Nov 2008, Hans Hagen wrote: > 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)
I just did an expanded comparison outside metapost. It was much easier that way. Thanks, Aditya ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________