lua-users home
lua-l archive

Re: 'in' keyword today (was Re: mathlib)

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Apr 10, 2014 at 8:16 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> I'm happier with the notion that `x,y,z in tbl` is just a synonym for
> `tbl.x, tbl.y, tbl.z`. The above would be better described by
> { 'a', 'b', 'c' }[1,2,3] — but let's not hijack this thread.
Yes, we have the (modified) Peter patch where the statement
[local] x,y,z in tbl
is [local] x,y,z = tbl.x, tbl.y, tbl.z
(modulo temporary for expressions)
and Coroutines is suggesting (in addition?) that
x,y,z in tbl
is a multi-valued expression meaning tbl.x,tbl.y,tbl.z
The first is straightforward, convenient and easy to explain. The
second - I don't know; it would lead to rather obscure code. We
should not feel compelled to do everything in one statement, after all
(leads to some of the more unreadable Python idioms).

AltStyle によって変換されたページ (->オリジナル) /