[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luaffi vs luajit ffi
- From: Miles Bader <miles@...>
- Date: Wed, 23 May 2012 07:35:12 +0900
Cosmin Apreutesei <cosmin.apreutesei@gmail.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
-miles
--
Patience, n. A minor form of despair, disguised as a virtue.