Re: A tricky way to determine Lua version
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: A tricky way to determine Lua version
- From: Pierre-Yves Gérardy <pygy79@...>
- Date: 2018年6月29日 17:17:44 +0200
On Fri, Jun 29, 2018 at 12:32 PM, Thijs Schreijer
<thijs@thijsschreijer.nl> wrote:
> It also misses detection of LuaJIT’s 5.2 compatibility flag
Feature detection is sometimes more actionable than version detection.
Things like
local supportsJIT = jit and jit.status() -- for efficient use of the FFI lib
local supportsGoto = not not(loadstring or load)"::a::"
local supportsTable__len = not #setmetatable({},{__len = function()end})
—Pierre-Yves