Hello,
Category codes are quite often changed dynamically, so that could become a problem in real life documents rather quickly, I'm afraid.
You are of course right. TeX avoids this problem by fixing a character's catcode when reading it; Lua would have to use not the current catcodetable, but the catcode of the characters it processes. Since Lua has no concept of catcodes, this would be impossible, at least without substancial changes to Lua.
And while we're at it: Should string.uppercase and string.lowercase use the \lccode/\uccode tables? [...] Three: (and this is by far the most important one) using string.uppercase and string.lowercase is not a good idea. It is much better to use the unicode-aware functions in the unicode library.
Then I think string.uppercase and string.lowercase should point to the corresponding function in the unicode library to prevent confusion and bugs. Or is there a reason to keep the old functions around?
When tracing assignments, the ones made from Lua are flagged as being \global (BTW: What are these messages about `reassigning [no_local_whatsits]'?):
That is a bug, actually. It is currently using a non-initialized stack variable for the global/local decision, and I could make it do either.
I do not quite understand which part of the above text you are adressing. Which one is a bug? The global assignments made from Lua, or the reassigning of [no_local_whatsits]? Inferring from Hans' mail, I would suspect the latter. Jonathan