[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Deprecating setfenv()
- From: François Perrad <francois.perrad@...>
- Date: Sun, 10 Jan 2010 18:36:03 +0100
In Lua 5.1, setfenv(f, table) & debug.setfenv(object, table) are not
equivalent, debug.setfenv() is a low level function.
In my module lua-Coat (http://github.com/fperrad/lua-Coat/), I use
setfenv with a stack level.
With Lua 5.2, the following code :
setfenv(3, M)
could be rewrite (and work with Lua 5.1 & Lua 5.2)
require 'debug'
...
debug.setfenv(debug.getinfo(3, 'f').func, M)
The param 'f' seems optional.
What is the level of stability of the interface of debug.getinfo() ?