lua-users home
lua-l archive

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


2016-07-19 14:57 GMT+08:00 Oliver Kroth <oliver.kroth@nec-i.de>:
> Interesting, but out of curiosity. Wouldn't  debug.setmetatable(nil,{__index
> = {}}) be faster and arguably simpler? -- Thomas
> I guess not. Lua would then try to look up the key in the empty {} table,
> and fail
>

But it will return a nil, and index a nil still return a nil, seems no problem.

> --
> Oliver
>



-- 
regards,
Xavier Wang.