4 ms·
It's not like Objective-C, which returns a nil value when sending a message to nil. Lua, on the other hand, throws an error when attempting to index nil.
by vor_ 13y ago
It's not like Objective-C, which returns a nil value when sending a message to nil. Lua, on the other hand, throws an error when attempting to index nil.
- anonymoushn 13y agoYou can change this to be more like Objective-C: debug.setmetatable(nil, {__call = function() return nil end, __index = function() return nil end}) f = nil print(f(f.bar.baz)()()()) -- nil This seems like an especially awful idea to me, though.