lua-users home
lua-l archive

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


> > 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