[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: luaffi vs luajit ffi
- From: Miles Bader <miles@...>
- Date: Wed, 23 May 2012 07:35:12 +0900
Cosmin Apreutesei <email@example.com> writes:
>> Writing code that runs under 5.1 / 5.2 / non-FFI-LuaJIT is
>> generally very easy, because differences are quite minor.
> I have 60 modules starting with setfenv(1, require'winapi') so that
> everything goes in the same namespace. What would be a reasonable
> migration option to 5.2 for this?
Maybe something like:
local _ENV = require 'winapi' -- handles 5.2
if setfenv then setfenv (1, _ENV) end -- handles 5.1
Patience, n. A minor form of despair, disguised as a virtue.