[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 'in' keyword today (was Re: mathlib)
- From: Coroutines <coroutines@...>
- Date: Wed, 9 Apr 2014 13:13:50 -0700
>From what I remember, extending the 'in' keyword was originaly
propositioned in this form only:
local a, b, c in some_table
I consider it an advance to make it more general for expanding a
vararg from a table without an intermediate table:
The expression: a, b, c in some_table -- which can appear in any expression
Making this syntactic sugar:
local a, b, c in some_table -- parsed as: local a, b, c = a, b, c in
some_table becomes: local a, b, c = some_table.a, some_table.b,
some_table.c
While still allowing people the potential to prefix local imports:
local pre_a, pre_b, pre_c = a, b, c in some_table
A new question: Should only valid identifiers be used before the
'in'? Or do we allow identifiers and objects?
local t = {}
some_table[t] = 'cat'
local a = t in some_table
(Do we index from some_table by identfier name or by what it
potentially references?)
I vote by identfier names only, I would see the 2nd as being somewhat confusing.
- References:
- Re: mathlib, Roberto Ierusalimschy
- Re: mathlib, Luiz Henrique de Figueiredo
- Re: mathlib, Roberto Ierusalimschy
- Re: mathlib, Christopher Berardi
- Re: mathlib, steve donovan
- Re: mathlib, Christopher Berardi
- Re: mathlib, Sean Conner
- Re: mathlib, Coroutines
- Re: mathlib, Sean Conner
- Re: mathlib, Christopher Berardi
- Re: mathlib, steve donovan
- Re: mathlib, Coroutines
- Re: mathlib, steve donovan
- Re: mathlib, Coroutines
- 'in' keyword today (was Re: mathlib), Petite Abeille
- Re: 'in' keyword today (was Re: mathlib), Rena
- Re: 'in' keyword today (was Re: mathlib), Philipp Janda
- Re: 'in' keyword today (was Re: mathlib), Coroutines
- Re: 'in' keyword today (was Re: mathlib), Dirk Laurie
- Re: 'in' keyword today (was Re: mathlib), steve donovan
- Re: 'in' keyword today (was Re: mathlib), steve donovan
- Re: 'in' keyword today (was Re: mathlib), steve donovan
- Re: 'in' keyword today (was Re: mathlib), Petite Abeille
- Re: 'in' keyword today (was Re: mathlib), steve donovan
- Re: 'in' keyword today (was Re: mathlib), Petite Abeille
- Re: 'in' keyword today (was Re: mathlib), Coroutines
- Re: 'in' keyword today (was Re: mathlib), Petite Abeille