Hi Hans, I'm doing some further experiments with the utf and lpeg libraries. This code fails, and I don't understand why: local s = "Ä" print(characters.uccode(s)) mtxrun --script test.lua ./test.lua:3: attempt to index global 'characters' (a nil value) Thomas
On 1/9/2019 8:43 AM, Thomas A. Schmitz wrote:
Hi Hans,
I'm doing some further experiments with the utf and lpeg libraries. This code fails, and I don't understand why:
local s = "Ä"
print(characters.uccode(s))
mtxrun --script test.lua
./test.lua:3: attempt to index global 'characters' (a nil value) mtxrun has al the basic modules in it but not the character ones (thinking of it, i can add an autoload for that, maybe i should do that)
so you need: require "char-ini" local s = "Ä" print(characters.uccode(s)) which will load char-def.lua (you really don't want that in mtxrun.lua embedded) and char-ini.lua 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 -----------------------------------------------------------------
On 1/9/19 9:47 AM, Hans Hagen wrote:
mtxrun has al the basic modules in it but not the character ones (thinking of it, i can add an autoload for that, maybe i should do that)
so you need:
require "char-ini"
Hans, Luigi, thanks a lot, that solves it! Maybe autoload or at least a small hint in cld-mkiv.pdf? Thomas
participants (3)
-
Hans Hagen
-
luigi scarso
-
Thomas A. Schmitz