lua-users home
lua-l archive

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


On 19 July 2016 at 12:32, Oliver Kroth <oliver.kroth@nec-i.de> wrote:
> It returns a nil, but needs to return an empty table that can be indexed;
> nil can't be indexed.


it can after setting the metatable

> =a.b.c
stdin:1: attempt to index global 'a' (a nil value)
stack traceback:
stdin:1: in main chunk
[C]: at 0x00404750

> debug.setmetatable(nil,{__index={}})
> =a.b.c
nil



-- 
Javier