Hello,
- When setting a \toks register in Lua using tex.toks['foo'] = 'bar' et.al., what catcodetable is used? From looking inside luatex.web, I would guess that, since str_toks is used, all characters get catcode 12, except for spaces, which get catcode 10.
Correct. It is one of the first things I wrote, and it definately needs updating. I now believe the toks array should accept and return token list tables (instead of lua strings), and there should be helper functions to_string() and to_tokenlist() for going back and forth. That needs a bit of (not-yet-done) programming, but it is not hard at all.
I'm wondering how this would affect performance. How costly is the conversion from a string to a table? And what about tex.print? Since it creates/writes tokens as well, will it be changed to accept token list tables, too? (at any rate, I think both should accept the same parameter type)
Cheers, Taco
Jonathan