[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Long chains of objects (aka tables)
- From: Andrew Starks <andrew.starks@...>
- Date: Sat, 17 May 2014 13:50:43 -0500
On Saturday, May 17, 2014, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> I want something like |local v = t?t1?t2?t3|... (actually I want
> |local v = t?.t1?.t2?.t3|...)
Another option:
local v = (((t or E).t1 or E).t2 or E).t3
(where E={} is defined somewhere in your code...)
For practical use cases that I've run into, where it's only one or two points in the chain, this solution would work for me.
Thank you!
-Andrew
-- Roberto