[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: ipairs in Lua 5.3.0-alpha
- From: Coda Highland <chighland@...>
- Date: Fri, 15 Aug 2014 11:10:00 -0700
On Fri, Aug 15, 2014 at 11:01 AM, Jan Behrens
<jbe-lua-l@public-software-group.org> wrote:
>> Not to mention a lot of drivers know the size of the resultset before
>> they start streaming records to you anyway.
>>
>> /s/ Adam
>>
>
> And some drivers don't. It would be nice to be able to use ipairs(...)
> here as well. What's the sense of ipairs anyway, if it behaves the same
> as the arithmetic "for"?
>
> -- Jan
>
That question is the reason ipairs() was nearly removed. Parallel
construction is the only reason I can see for it -- making iteration
over a sequence visually the same as iteration over any other
well-defined collection.
Now, as for the database example, you really shouldn't want to use
ipairs() or pairs() for that ANYWAY. You should be using something
like "resultset:rows()".
/s/ Adam
- References:
- Speed of # operator (Was: ipairs in Lua 5.3.0-alpha), Dirk Laurie
- Re: Speed of # operator (Was: ipairs in Lua 5.3.0-alpha), Enrico Colombini
- Re: Speed of # operator (Was: ipairs in Lua 5.3.0-alpha), Jan Behrens
- Re: Speed of # operator (Was: ipairs in Lua 5.3.0-alpha), Roberto Ierusalimschy
- Re: ipairs in Lua 5.3.0-alpha, Jan Behrens
- Re: ipairs in Lua 5.3.0-alpha, Jan Behrens
- Re: ipairs in Lua 5.3.0-alpha, Roberto Ierusalimschy
- Re: ipairs in Lua 5.3.0-alpha, Jan Behrens
- Re: ipairs in Lua 5.3.0-alpha, Jan Behrens
- Re: ipairs in Lua 5.3.0-alpha, Roberto Ierusalimschy
- Re: ipairs in Lua 5.3.0-alpha, Jan Behrens
- Re: ipairs in Lua 5.3.0-alpha, Doug Currie
- Re: ipairs in Lua 5.3.0-alpha, Coda Highland
- Re: ipairs in Lua 5.3.0-alpha, Jan Behrens