It would be nice if we could figure out what to do about iterators for
0.1. I was thinking that we could make them Java-style iterators -- that
is, objects with has_next() : bool and next() : T methods. |for each|
would simply be syntactic sugar.
This form:
for each (x in iter()) {
On principle I do not want us to go down this path, even if we change later. It
adds risk that we won't change. It imposes a stateful model on iterators where
has_next and next must be coherent, and you have to write two methos (not one
as in Python or JS.next). And, Java.
/be
On Sep 28,
On 9/28/11 5:27 PM, Brendan Eich wrote:
On principle I do not want us to go down this path, even if we change later. It
adds risk that we won't change. It imposes a stateful model on iterators where
has_next and next must be coherent, and you have to write two methos (not one
as in Python or
On Sep 28, 2011, at 5:53 PM, Patrick Walton wrote:
On 9/28/11 5:27 PM, Brendan Eich wrote:
On principle I do not want us to go down this path, even if we change later.
It adds risk that we won't change. It imposes a stateful model on iterators
where has_next and next must be coherent, and
+1 This is nice. Should make iterating over ML-style lists very natural. Not
sure how you would write a closure for an array, could you post a sample for
that?
-Rob
On Wed, Sep 28, 2011 at 5:54 PM, Brendan Eich bren...@mozilla.org wrote:
On Sep 28, 2011, at 5:53 PM, Patrick Walton wrote:
On