Jonathan Sauer wrote:
I'm wondering how this would affect performance. How costly is the conversion from a string to a table?
pretty bad. But would you normally assign lots of stuff to a toks register after building it up by hand? I imagined that would more likely be something previously returned from a different token register, or the replacement of a macro or something. In lua it is actually possible to do both types at the same time, so there is no need to decide either way, but token list tables do fit the internal structure better.
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)
tex.print writes input strings (one-line files, if you will). The concept and effect is somewhat different from a token list. The differences are subtle, but important. A special function like tex.tprint is not a bad idea, but we have not really needed it yet. Cheers, Taco