On Fri, 04 Oct 2013 10:54:37 +0200, Hans Hagen
On 10/4/2013 10:47 AM, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
Hello all,
how to call \let from within Lua?
I'd need to "\let\T=4" using Lua.
The following code doesn't work (not so surprisingly):
---- \startluacode a = 4 \stopluacode
\expandafter\let\expandafter\T=\cldcontext{a}
\starttext Test \T. \stoptext ----
What's the correct way?
why let and not context.setvalue("T","4")
anyway ...
\startluacode a = 4 \stopluacode
\normalexpanded{\let\noexpand\T\cldcontext{a}}
\starttext Test \T. \stoptext
You need more \expandafter because \cldcontext needs two expansion steps: \expandafter\expandafter\expandafter\let\expandafter\expandafter\expandafter\T\expandafter\expandafter\expandafter=\cldcontext{a} but I wonder why you don use \def or \edef: \edef\T{\cldcontext{a}}
... OK, thank you, Hans & Wolfgang, for your responses. Best regards Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038