Hi, So far we have \lua {...} : expanded, result of tex.print is inserted with catcodes 11/12 \lua otr {...} : delayed expansion (in otr), only pdf.print is used, tex.print is ignored currently we need to use \scantokens to process the result of tex.print in a texie way (current catcode regime). So, in addition we can have: \lua tex {...} : expanded, result of tex.print is fed into internal scantokens This saves passing args around. we also need: \luatexversion (currently 0.1.5) \luaversion (currently 5.0.2) 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 -----------------------------------------------------------------
Hi Hans, Hans Hagen wrote:
Hi,
So far we have
\lua {...} : expanded, result of tex.print is inserted with catcodes 11/12 \lua otr {...} : delayed expansion (in otr), only pdf.print is used, tex.print is ignored
I'm still not completely sure this will work out. Having multiple primitives without keywords is definately easier to work with.
currently we need to use \scantokens to process the result of tex.print in a texie way (current catcode regime). So, in addition we can have:
\lua tex {...} : expanded, result of tex.print is fed into internal scantokens
Sure, no problem.
This saves passing args around.
But beware, you may end up being forced to create extra macros because you cannot skip over the actual keyword "tex" using \expandafters.
we also need:
\luatexversion (currently 0.1.5)
This is "whatever version we want to use, right?". I'd like to use this number instead of the pdftex/etex version string in the banner (the 1.30.3-2.2 part), and use pdfluatex as executable name. Is that acceptable ? (I'd like to 'flatten' the existing change files, as I proposed on the pdftex list a month or so ago).
\luaversion (currently 5.0.2)
It seems the Lua we use right now has version #define LUA_VERSION "Lua 5.1 (alpha)" and also #define LUA_VERSION_NUM 501 but that is never used. I assume that the version will become 510 soon. Anyway, you can get the lua version string from inside \lua, as _VERSION, so there is not really a need for a separate primitive. Let's not forget the primitive \luaesc, btw. Greetings, Taco
Taco Hoekwater wrote:
But beware, you may end up being forced to create extra macros because you cannot skip over the actual keyword "tex" using \expandafters.
ah, indeed, so let's go for multiple primitives then
we also need:
\luatexversion (currently 0.1.5)
This is "whatever version we want to use, right?". I'd like to use this number instead of the pdftex/etex version string in the banner (the 1.30.3-2.2 part), and use pdfluatex as executable name. Is that acceptable ? (I'd like to 'flatten' the existing change files, as I proposed on the pdftex list a month or so ago).
ok
\luaversion (currently 5.0.2)
this was what my command line version reported; looks like i need to update -)
It seems the Lua we use right now has version
#define LUA_VERSION "Lua 5.1 (alpha)"
and also
#define LUA_VERSION_NUM 501
but that is never used.
I assume that the version will become 510 soon. Anyway, you can get the lua version string from inside \lua, as _VERSION, so there is not really a need for a separate primitive.
ah, indeed
Let's not forget the primitive \luaesc, btw.
indeed and maybe also tex.def("whatever","...") tex.edef("whatever","...") so that we can play with the hash Hans 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 -----------------------------------------------------------------
Hi, concerning the hash ... i'd like to do the equivalent of: tex.def("\\", "\string\\") or, to avoid messing aroudn with parameters tex.set of course the previous def should be something tex.set("\string\\", "\string\string\string\\") but anyhow, it would permit defining macros in a non interfering way. For that we need two hooks: \everybeforelua \everyafterlua 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 -----------------------------------------------------------------
Hans Hagen wrote:
Hi,
concerning the hash ...
i'd like to do the equivalent of:
tex.def("\\", "\string\\")
or, to avoid messing aroudn with parameters tex.set
of course the previous def should be something
tex.set("\string\\", "\string\string\string\\") but anyhow, it would permit defining macros in a non interfering way. For that we need two hooks: \everybeforelua \everyafterlua
I'm a bit confused by this. Can you post a non-trivial example of what you want to achieve? Taco
Taco Hoekwater wrote:
Hans Hagen wrote:
Hi,
concerning the hash ...
i'd like to do the equivalent of:
tex.def("\\", "\string\\")
or, to avoid messing aroudn with parameters tex.set
of course the previous def should be something
tex.set("\string\\", "\string\string\string\\") but anyhow, it would permit defining macros in a non interfering way. For that we need two hooks: \everybeforelua \everyafterlua
I'm a bit confused by this. Can you post a non-trivial example of what you want to achieve?
\def\whatever{one} lua { tex.set("whatever","two") } \whatever -> two ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Taco Hoekwater wrote:
tex.set("\string\\", "\string\string\string\\") but anyhow, it would permit defining macros in a non interfering way. For that we need two hooks: \everybeforelua \everyafterlua
I'm a bit confused by this. Can you post a non-trivial example of what you want to achieve?
something: \newtoks\luabefore \newtoks\luaafter \def\mylua#1% {\the\luabefore \lua {#1}% \the\luaafter} this one pick up the #1 (slows down) contary to a luabefore|after mechanism. This will permit us to push/pop meanings if macros and permit: \luabefore{\bgroup \def\\{\string\\}} \luaafter {\egroup} \lua {tex.print(\\hbox{blabla}")} instead of \lua {tex.print(\string\\hbox{blabla}")} 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 -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Taco Hoekwater