[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Signature of iterator factories
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 3 Nov 2009 09:33:28 -0200
> > At this point, I'm sure too much code would break to introduce any
> > changes. But if we were designing iterators from scratch,
> > wouldn't it be nice to give them this signature instead:
> >
> > generator(control_variable, state_var1, ...)
>
> Yes. :(
>
> -- Roberto
I am sorry, but I sent a wrong reply. I thought his proposal was to
have an extra hidden (but unique) control variable before the visible
variables in the loop. That is, the statement
for a,b,c in exp do
would be really
for _,a,b,c in exp do
with '_' hidden from the programmer.
-- Roberto