lua-users home
lua-l archive

[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