20 Feb
2007
20 Feb
'07
9:08 a.m.
Hi Jjgod, Jjgod Jiang wrote:
Hi,
I'm wondering if I can register a Lua function as callback on the expansion of a specific macro? I'm expecting something like this:
\def\hello#1{#1}
callback.register("macro.hello",lua_func_hello)
when using \hello{abc}, the lua_func_hello will get called and have access to the arguments of \hello (abc).
In this way, we can implement loop structure in lua (which I think is a cleaner way than tail recursion in TeX).
Not right now, but soon. (perhaps using a slighly different interface, because your example makes the macro definition body pointless, and that can be confusing). Cheers, Taco