lua-users home
lua-l archive

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


Anyone have a patch that makes it so userdata has no environment by default?

If I just set "env" to NULL in newuserdata() will lua_getfenv return
nil?  Any gotchas in there?

To be honest I can't figure out why userdata values get an environment
by default because this seems counterintuitive (seeing as how userdata
doesn't use the environment table for anything) and makes it very
difficult to do optional environments with your custom data types.

CR