I wish userdata could be used in the same
place a string is expected. I would love an "invisible" memcmp() if
it's a userdata-string comparison (==) or to be able to directly use
the string.*() functions on them.
One of the basic goals of userdata is that it NOT be mutable (or even viewable) from Lua. The contract is that C code can let Lua act as custodian for some state which it knows Lua *cannot* access; it is opaque to Lua by design. Of course, C code can expose the data indirectly, but that is the business of the C code.
—Tim