lua-users home
lua-l archive

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


On Fri, Dec 18, 2009 at 2:39 PM, Francesco Abbate <gslshell@gmail.com> wrote:
> Seems to be a nice solution! I was not aware that you can attach an
> environment to a table. I think I'm going to stick with this solution
> since it offers the same thing that I was suppose to achieve with
> lua_setusedataref. I guess that in term of performance is still
> reasonable... wait, is it really reasonable? to create a new
> *environment* for each object ??? I guess yes since a new environment
> it turns out to be just a Lua ordinary table.

That can be a lot of tables. Usually its OK.

Personally, I wish I could use any lua value as an argument to
lua_setfenv(). It would be easier in simple cases.

I don't understand why lua would care if I used a function object, or
a userdata object. Unlike the fenv of a function, its
not used by lua, just by my code.

Sam