[NTG-context] Exchangeing content of variables between luacode and context

Rudolf Bahr quasi at quasi.de
Tue Nov 19 14:19:42 CET 2019


Hello All!

To send variable contents from context to luacode I can put them into the
function invocation or use 'tokens.getters.macro("TestA")',
an interesting and very nice possibility to let luacode itself getting
contents of context macros. The (only?) way back, from luacode to context,
could be done by 'tokens.setters.macro("TestA","a")' [1] .

Now, to store Luacode's variable contents permanently in context programs
I could Luacode let copy my ConTeXt program to another place on disk with
a newly defined macro inside. But, does somebody know (by chance) of another,
more elegant possibility? I think giving back a value by "return" won't work.

Best wishes,
Rudolf


[1] Hans Hagen, "ConTeXt Lua Documents", January 12, 2018, 7.4, page 63


More information about the ntg-context mailing list