[luatex] Luatex primitive names
Heiko Oberdiek
oberdiek at uni-freiburg.de
Wed Mar 11 01:53:33 CET 2009
On Tue, Mar 10, 2009 at 06:36:28PM -0500, Karl Berry wrote:
> Taco (or anyone) -- is there some simple Lua function which returns some
> engine identification?
>
> I'm thinking of something like
> \directlua{tex.engine_ident()} (sorry, wrong syntax, I know),
> which both luatex and xetex could implement.
>
> (I concur with the opinions of only exposing \directlua.)
I don't unless I have misunderstood something:
\directlua{...} generates an error message for older versions,
because it requires a number for the lua state.
In newer versions the number shouldn't be given, because it
would cause a deprecation warning -- users always complain
about warnings. Thus the version information is already
needed at TeX level before switching to Lua.
Thus the syntax change for \directlua (and perhaps later
changes) vote for something extra:
\luatexversion is a good choice in my opinion.
It says in my eyes, `hey, I provide the features, described
in the LuaTeX manual for the version number I return'.
This is a clean way for testing without the need to use some
complicate dubious heuristics.
BTW, from the experience of the history of pdfTeX, I would like
some version information in the LuaTeX manual:
* Mapping \luatexversion -> official LuaTeX version number
* Version information for each feature/primitive, when
it was introduced and when changes occur.
It would help macro programmers to write robuster code
without studying old announcements and logs of the version control
system.
Yours sincerely
Heiko <oberdiek at uni-freiburg.de>
More information about the luatex
mailing list