[NTG-context] new lmtx upload

Hans Hagen j.hagen at xs4all.nl
Tue May 12 16:35:20 CEST 2020


Hi,

The tex engine has at most 65K dimen and count registers and these can 
be local and global (although mixing these two models for the same 
variable can be inefficient).

Anyway, in the current upload there is a mechanism for using way more 
variables, global ones, that are managed by lua:

\luadimen test 100pt

\scratchdimen = .25 \luadimen test

\the\scratchdimen

\the\luadimen test

So, they act as normal dimensions and counters wrt assignment and 
serialization and such. There are also floats and booleans (in addition 
to integers and cardinals).

Then, as another experiment, there are one/two dimensional arrays of 
variables. Think of:

\newarray name whatever type integer nx 100 ny 500

\arrayvalue whatever 20 30 1024

\the\arrayvalue whatever 10 30

\the\arrayvalue whatever 20 30

\the\arrayvalue whatever 30 30

Some more info can be found in the last chapoter of the evenmore.pdf 
document. The question is: do we need this, and if so, do we need more 
of that. It's a bit chicken-egg case: we can have lua and can pipe back 
to tex, and we can stay at the tex end.

This is a lmtx only feature. Just for the record: these are macros, not 
primitives, but they are rather efficient and have hardly any overhead.

The floats can be in 1.23 format, 1.23e45 format and also in 0x12p34 
format, while integers can be in 123 format and 0x123 format; the hex 
float format is lua's way of being roundtrip.

Hopefully there are no side effects.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list