lua-users home
lua-l archive

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


> I don't think any scheme with weak tables will work correctly, and it
> would be too slow anyway

Why? (for both statements...)


> That array should be accessible given only a pointer to the userdata,
> and not the actual Lua object (e.g. by storing the array immediately
> before the userdata and counting backwards).

The idea of userdata keeping direct references to other Lua objects
is nice. The original Smalltalk had something quite similar: Objects
could have an optional "raw" area plus an "array" area. But to make them
accessible given only a pointer seem dirty and dangerous. (Among other
things, how to avoid the userdata being collected?)

-- Roberto