lua-users home
lua-l archive

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


On Sun, Jul 31, 2011 at 06:43:23PM +0200, Duncan Cross wrote:
> 
> Ah, but with LuaJIT FFI, null pointer values are considered equal to
> nil, but are *not* logically false:
> 
>  > ffi = require 'ffi'
>  > null = ffi.new('void*')
>  > print(null == nil)
>  true
>  > print(not null)
>  false
> 

All LuaJIT versions with FFI are still beta only, and the equality
of a null cdata with a Lua nil is therefore not yet cast in concrete 
for all eternity.  May I respectfully suggest that this issue be 
be high up on the list of things that should change.   Instead, 
`ffi.null` as a predefined constant, different from `nil`, could be 
a useful addition.

Dirk