lua-users home
lua-l archive

Re: Userdata environment example (Re: GC method for objects)

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


Hi,
I wrote:
> [Umm ... I just noticed a restriction in lua_setfenv() that the
> environment must be a table and cannot be any arbitrary Lua object.
> While this makes sense for Lua functions, it removes some flexibility
> for C functions and userdata objects. Maybe this was done for
> consistency? Roberto?]
Uh, sorry. Forget this. It's a Table * and not a TValue (i.e. it
takes less space than a C function with a single upvalue previously
took).
[And no, I think the flexibility of a TValue would not be worth
the space overhead -- one can use an upvalue for those rare cases.]
Bye,
 Mike

AltStyle によって変換されたページ (->オリジナル) /