Comment

Comment by strait

When does

    if x and x == nil
ever evaluate to true in LuaJIT? What does the FFI have to do with it? Please explain.

Edit:

I think I see what you mean here. The x variable is actually a CDATA object returned by the LuaJIT FFI. Upon comparison, the NULL pointer value inside would be converted to nil. I don't see this as being a 'footgun' unless you forget that you're dealing with a CDATA object.

parent strait 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton