lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Not to mention it would be annoying beyond belief to lose userdata already stored
inside tables whenever you change the data inside of it.

On Mon Jan 28 20:27 , Javier Guerra Giraldez <> sent:

>as most inmutable-strings languages, Lua makes all identical strings be the 
>same.  that is, at creation time, if a string matches another one, the new 
>one is discarded and the old one is used instead.
>you wouldn't want this to be done automatically to your userdata, since Lua 
>can't know what you'll do with the contents.  IOW, userdata isn't inmutable; 
>therefore can't share the same space for several instances.
>so, for userdata, the hash source is the pointer, not the content.