[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 12:46:25 -0500
On Saturday, May 17, 2014, Petite Abeille <petite.abeille@gmail.com> wrote:
On May 17, 2014, at 7:07 PM, Thiago L. <fakedme@gmail.com> wrote:
> I want something like |local v = t?t1?t2?t3|... (actually I want |local v = t?.t1?.t2?.t3|…)
Why don’t you simply write a little function that does exactly that then?
v = get( t, ‘1.2.3.4.5.6.7.8.9’ )
Actually, that's better than any alternate I've tried. For me, speed isn't a huge part. It's more clarity. Long chains of this kind of stuff, currently span multiple lines. Sometimes "clear" isn't clear and I split it into two statements.
Your approach would work better in that circumstance. The ? Would be clearest, when this comes up. Especially when ? Is at its deepest.
A.b.c.d.e?.d.e