[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Any pitfalls to the nil index idiom?
- From: "Thomas Jericke" <tjericke@...>
- Date: Tue, 19 Jul 2016 08:15:39 +0200
-----Original Message-----
> From: "Dirk Laurie" <dirk.laurie@gmail.com>
> To: "Lua mailing list" <lua-l@lists.lua.org>
> Date: 18-07-2016 18:26
> Subject: Re: Any pitfalls to the nil index idiom?
>
> 2016-07-18 18:20 GMT+02:00 Roberto Ierusalimschy <roberto@inf.puc-rio.br>:
> >> debug.setmetatable(nil,{__index = load''})
> > ??????
>
> load'' (that's two single quotes, not one double quote) is equivalent to
> function(...) return end
Interesting, but out of curiosity. Wouldn't
debug.setmetatable(nil,{__index = {}})
be faster and arguably simpler?
--
Thomas