[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Regarding the name 'pairs'
- From: "John Hind" <john.hind@...>
- Date: Mon, 14 Sep 2009 09:24:33 +0100
This is good, but trouble is you get lots of global iterator factories with
ill-defined behaviour if applied to the wrong class. The method approach
solves this, so:
for v in set:values() do ... end
But the need for that empty parenthesis still rankles ...
> -----Original Message-----
> From: firstname.lastname@example.org [mailto:lua-
> email@example.com] On Behalf Of Miles Bader
> Sent: 14 September 2009 09:00
> To: TNHarris
> Cc: Lua list
> Subject: Re: Regarding the name 'pairs'
> TNHarris <firstname.lastname@example.org> writes:
> > It's "each" instead of "iterate" simply for being shorter. I don't
> > particularly care for "iter" and "enum" because they're
> > And "enum" already has a meaning in C.
> Hmm, I'd use "values(set)" rather than "each":
> for v in values(set) do ... end
> Fast, small, soon; pick any 2.