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? TIA. 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
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 ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Am 04.10.2013 um 10:47 schrieb Procházka Lukáš Ing. - Pontex s. r. o.
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?
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}} Wolfgang
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
participants (3)
-
Hans Hagen
-
Procházka Lukáš Ing. - Pontex s. r. o.
-
Wolfgang Schuster