lua-users home
lua-l archive

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

On Thu, Nov 18, 2010 at 5:11 AM, Mike Pall <> wrote:
> David Manura wrote:
>> One thing that concerns me here is that in 5.2, "C
>> functions do not have environments any more"--is that a problem when
>> backporting lightweight C functions to 5.1/LuaJIT?
> Yes. I can't add anything similar to LuaJIT, because C functions
> still _do_ have an environment in 5.1.

Maybe LuaJIT2, as well as a compatibility patch to Lua 5.1, could
implement a non-standard "lua52_pushcfunction" that behaves like the
5.2 version?  Then the user may alias lua_pushcfunction and
lua52_pushcfunction via compiler defines to allow a single piece of
code to target different Lua versions (i.e. 5.1 + compatibility
patches, 5.2, and LuaJIT2).