lua-users home
lua-l archive

Re: Lookup nil table index

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


Roberto wrote:
You can achive this by setting an __index metamethod for
nil, but you will have to set it through C.
Or with the debug library:
 Lua 5.1.1 Copyright (C) 1994-2006 Lua.org, PUC-Rio
 > debug.setmetatable(nil, {__index = function() return nil end})
 > print(thing.foo.bar.this.that)
 nil
--
Aaron
Beginning Lua Programming:
http://www.amazon.com/gp/product/0470069171/
http://search.barnesandnoble.com/booksearch/isbninquiry.asp?ISBN=0470069171

AltStyle によって変換されたページ (->オリジナル) /