lua-users home
lua-l archive

Re: A tricky way to determine Lua version

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


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

AltStyle によって変換されたページ (->オリジナル) /