lua-l archive
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
] [
Date Index
] [
Thread Index
]
Subject
:
Re: Any pitfalls to the nil index idiom?
From
: Egor Skriptunoff <egor.skriptunoff@
...
>
Date
: Mon, 18 Jul 2016 21:15:03 +0300
So, the discussion is about "early error detection in Lua programs" vs. "handy behavior of emptiness"?
On Mon, Jul 18, 2016 at 5:53 PM, Dirk Laurie
<
dirk.laurie@gmail.com
>
wrote:
debug.setmetatable(nil,{__index = load''})
Let's make one more step in that direction:
local nop = load''; debug.setmetatable(nil, {__index = nop, __call = nop})
P.S. BTW, thanks for codegolf trick :-)
Follow-Ups
:
Re: Any pitfalls to the nil index idiom?
,
Jay Carlson
References
:
Any pitfalls to the nil index idiom?
,
Dirk Laurie
Prev by Date:
Re: next bug? (lcode.c:389: freereg: Assertion `reg == fs->freereg' failed.)
Next by Date:
Strange header value for compiled code
Previous by thread:
Re: Any pitfalls to the nil index idiom?
Next by thread:
Re: Any pitfalls to the nil index idiom?
Index(es):
Date
Thread