[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: '__iter', yet again!
- From: Cosmin Apreutesei <cosmin.apreutesei@...>
- Date: Wed, 16 Dec 2009 21:36:00 +0200
> P.S. This sort of sequence is one of the places where it would have been really nice if the end of an iteration were signaled by returning nothing rather than by returning nil. There could be map operations, for example, that result in nil where we don't want to actually terminate the iteration.
Allow me to diverge even more with another language change idea:
I wish select('#',...) wouldn't count trailing nils for more symmetry:
- f() same as f(nil)
- return nothing same as return nil
- unpack({...}) same as ...
- f(unpack(t))
Regarding the iterator protocol, I wish the iterator return a boolean
marker before var1 so that var1 can be nil, but that would break
compatibility :(
- References:
- Re: '__iter', yet again!, Jerome Vuarand
- Re: '__iter', yet again!, Jerome Vuarand
- Re: '__iter', yet again!, Luiz Henrique de Figueiredo
- Re: '__iter', yet again!, steve donovan
- Re: '__iter', yet again!, Javier Guerra
- Re: '__iter', yet again!, Mark Hamburg