lua-users home
lua-l archive

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


On Jan 12, 2010, at 12:28 PM, Francesco Abbate wrote:

> 2010/1/12 Tony Finch <dot@dotat.at>:
>> On Tue, 12 Jan 2010, Francesco Abbate wrote:
>> (2) is invalid because setfenv and getfenv cannot manipulate userdata
>> environments in 5.1 so there's no change in 5.2
> 
> I'm missing something because I'm using this feature with Lua 5.1.4.
> Here a sample of my code:

lua_setfenv and lua_getfenv can affect userdata afaik, and will continue to exist in the C API. However, the functions _G.setfenv and _G.getfenv as they are visible inside Lua have never been able to affect userdata, or indeed anything other than Lua closures.