On 7/14/2015 10:41 PM, Jaroslav Hajtmar wrote:
Hello ConTeXist.
I hope that my crazy questions not much bother.
This time I needed to get to the fair value of the parameter, delivering
to lua function over the content macros.
Obviously it's my misunderstanding of the functioning of expansion in
case maker with optional parameters, or you really can not explain the
functioning of the transmission values. It seems that is passed to a
sort of reference as to the actual contents of the macro perhaps can not
even get through Lua. Or did they?
The following minimal example, perhaps explain what going on.

Tex has tokens so "foo" is three tokens "f" "o" "o" and not a string. This means that you need to turn tokens into a string (using the (new)token library). It means that you need to be well aware of tex's internals and the way it deals with input -> tokenization -> expansion etc etc.

The question ultimately: Is there any alternative how using Lua somehow
easily evaluate the macro content? For example to determine whether two
different macros have the same content?

just avoid storing stuff in macros .. .as most you do seem to be lua, keep your data in lua. If you put something in a token register you can consult it as string but even then it cannot be what you expect as embedded macros don't get expanded (for good reason as they can be anything).

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 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 : 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
___________________________________________________________________________________

Reply via email to