lua-users home
lua-l archive

Re: Abolishing the numeric-for

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


Numeric iteration can be implemented more simply and efficiently as the simple numeric-for than as a case of the (relatively) complex generic-for. While Lua in general tries to consolidate concepts, the numeric-for is a case where the implementation is significantly simpler (and more efficient) on its own, as well as being a very common concept (similar to the implementation of tables having an array part, as the use of tables). On 2010年5月24日 14:46:46 -0700, Jonathan Castello <twisolar@gmail.com> wrote:
On Mon, May 24, 2010 at 2:44 PM, Stuart P. Bentley
<stuart@testtrack4.com> wrote:
While I think __iter is good idea, I wouldn't go so far as to say the
numeric-for should be abolished.
I'm curious, why not? "for i in 10, 100, 5 do' achieves everything the
numeric-for does. It might not need to be abolished, but I don't
particularly see a need for it either.
~Jonathan

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