lua-users home
lua-l archive

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



On 13-Feb-07, at 6:48 PM, Wesley Smith wrote:
I understand this is usally the case.  But I want per-instance custom
behavior whereas the metatable is for class behavior.  From the wiki
article:

"A userdata has both a metatable and an environment table. It seems
logical that the metatable contains information which is general to
the datatype of the userdata, while the environment table contains
information which is specific to the instance of the userdata."

What I don't undertand right now is how a userdata and its environment
table interact.


There's a more completely worked out example at UserdataEnvironmentExamples