[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Multiple values returned or vararg expression in numeric for loop
- From: Fidelis Assis <fidelis.assis@...>
- Date: Thu, 20 Sep 2012 15:45:29 -0300
2012/9/18 Dirk Laurie <dirk.laurie@gmail.com>:
>>
>> Good, thanks for the suggestion. But doing this naturally with be even
>> better :).
>>
>
> At present, if you write " in tbl" it means at the very
> least that you did not at that moment consciously decide whether it
> should be "pairs" or "ipairs".
Well, if I use a single var, "for v in tbl", I mean ipairs because I
don't need an extra var for the keys, they are easily recoverable if
needed - for normal Lua list tables starting at 1. That doesn't happen
with map tables, I need the extra var to correlate keys and values.
> In order to ensure that such inattention
> is in fact correct, you should have consciously assigned an appropriate
> metamethod to __call. This is sane behaviour which I would not like
> to see sacrificed.
But I see your point, though.
I'm not asking for any change in Lua, I'm quite happy with the way it
is. I just would be happier if I could use "for v in t" naturally, but
the metamethod way is fine with me.
--
Fidelis Assis
- References:
- Multiple values returned or vararg expression in numeric for loop, Egor Skriptunoff
- Re: Multiple values returned or vararg expression in numeric for loop, Michal Kolodziejczyk
- Re: Multiple values returned or vararg expression in numeric for loop, Roberto Ierusalimschy
- Re: Multiple values returned or vararg expression in numeric for loop, Dimitris Papavasiliou
- Re: Multiple values returned or vararg expression in numeric for loop, Luiz Henrique de Figueiredo
- Re: Multiple values returned or vararg expression in numeric for loop, Dimitris Papavasiliou
- Re: Multiple values returned or vararg expression in numeric for loop, Roberto Ierusalimschy
- Re: Multiple values returned or vararg expression in numeric for loop, Egor Skriptunoff
- Re: Multiple values returned or vararg expression in numeric for loop, Fidelis Assis
- Re: Multiple values returned or vararg expression in numeric for loop, steve donovan
- Re: Multiple values returned or vararg expression in numeric for loop, Fidelis Assis
- Re: Multiple values returned or vararg expression in numeric for loop, Petite Abeille
- Re: Multiple values returned or vararg expression in numeric for loop, Fidelis Assis
- Re: Multiple values returned or vararg expression in numeric for loop, Dirk Laurie