3 ms·
A null pointer is a boxed value in LuaJIT, therefore not nil. But it is equal to nil when compared with nil. local x = require('ffi').cast('void*', nil)
by elpocko 4y ago
A null pointer is a boxed value in LuaJIT, therefore not nil. But it is equal to nil when compared with nil.
local x = require('ffi').cast('void*', nil)
if x and x == nil then
print("x is truthy and nil at the same time")
end