[luatex] Luatex primitive names
Hans Hagen
pragma at wxs.nl
Wed Mar 11 12:20:38 CET 2009
Manuel Pégourié-Gonnard wrote:
> Heiko Oberdiek a écrit :
>> Thus the syntax change for \directlua (and perhaps later
>> changes) vote for something extra:
>> \luatexversion is a good choice in my opinion.
>
> One can also think of the following compromise: continue exposing \luatexversion
> as long as the \directlua syntax is not stable. Then expose only \directlua. So
> on can use (pseudo-code)
>
> \IfDefined{directlua}{%
> \IfDefined{luatexversion}{%
> % use \luatexversion
> }{%
> \directlua{%
> % or whatever the stable syntax of \directlua is
> if tex.luatexversion == nil then
> -- not running LuaTeX
> else
> -- use tex.luatexversion
> end
> }%
> }
\ifdefined\directlua
\ifdefined\luatexversion \else
\edef\luatexversion{\directlua0{tex.print(tex.luatexversion}}
\fi
\fi
now, since pre 0.40 all primitives are there anyway and since no
primitives other than \directlua are available 0.4 upwards ...
\ifdefined\directlua
\ifdefined\luatexversion \else
\edef\luatexversion
{\directlua\ifdefined\latelua0\fi{tex.print(tex.luatexversion}}
\fi
\fi
or something like that (well, not that i'd do it that way myself but ...)
also, as said before, the \directlua syntax *will be stable* in 0.40
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
More information about the luatex
mailing list