|
2014-04-16 9:34 GMT+02:00 Aapo Talvensaari <aapo.talvensaari@gmail.com>:
Lua strings are internalized. I.e. every time you have "my_long_string",> What was the main reason that the strings don't share the metatable (i.e.
> every string has a new { __index = string }, and not like every string has
> (the same) 'string' as a metatable? Also it is not possible to setmetatable
> to strings. Just being curious.
even if it is created by table.concat({"my","long","string"},"_"), it refers
to exactly the same string. It will be chaos if some string you have
just strung together has a metatable you did not know about.