[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Any pitfalls to the nil index idiom?
- From: Martin <eden_martin_fuhrspam@...>
- Date: Mon, 18 Jul 2016 19:10:53 -0700
On 16-07-18 07:53 AM, Dirk Laurie wrote:
> It has several times been noted on this list that you can have e.g.
> tbl.a.b.c.d.e evaluating to nil if any intermediate table does not exist,
> instead of raising an error, by
>
> debug.setmetatable(nil,{__index = load''})
>
> Is there any subtle undesirable consequence to doing this?
>
tbl.a.b.c.d.e = tbl.a.b.c.d.e or {}