[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 'in' keyword today (was Re: mathlib)
- From: Dirk Laurie <dirk.laurie@...>
- Date: Wed, 9 Apr 2014 10:22:38 +0200
2014-04-09 6:30 GMT+02:00 Coroutines <coroutines@gmail.com>:
> I think I would suggest both an 'in' and 'from' so this would be possible:
>
> local a, b, c in some_table
> local t_concat, t_insert = concat, insert from table
The proposed 'in' is attractive to those whose programming style
involves locals with the same name as globals (in _ENV) and
nothing like it can be done in Lua without duplicating the names.
Though this is a mere sugar, I would probably use it if available.
The fact that it does not require another keyword also counts
in its favour.
The proposed 'from', on the other hand, is not too hard to imitate
in pure Lua.
local t_concat, t_insert = from(table,"concat,insert")
I don't think the impact is dramatic enough to justify another keyword.
> I'm thinking about making it of the form: table.import(into, from,
> options{}, ...)
There is something not too dissimilar in Penlight — maybe Steve can
chip in here.
- 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