lua-users home
lua-l archive

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


Is there some reason behind enforcing userdata environment to be a table?

I'd like to associate some userdata B with already existing non-table value A. To achieve that, I have to create a new table, put A in there, and set that table as the environment for B. This new table seems totally unnecessary and affects efficiency. (I'd like to be able to just set A as the environment for B.)

A related issue: it seems that when a new userdata is created, its environment is set to the C-function environment. The Manual doesn't say anything about that. Is that an undocumented feature that is likely to change? Or am I overlooking something?

--
Shmuel