News for hackers. Stuff that matters.
Re:Philosophy and "for" loops — more from Go and Rust by rntz on Thursday July 11, 2013 @10:34AM (#6026236)
Internal iterators are just syntactic sugar for a higher-order function. As long as Rust has higher-order functions, internal iteration will be possible (just not "the standard way to do things").

Edit: In fact, this is true of any language with higher-order functions. For example, this is how you'd define a Rust-style internal iterator for lists in Racket scheme:

    (define (iter l f)
      (when (and (pair? l) (f (car l)))
        (iter (cdr l) f)))
And how you'd use it:

    ;; displays elements of the list, up to and including the first one >= 3
    (iter '(1 2 3 4) (lambda (x) (display x) (< x 3)))
Re:Philosophy and "for" loops — more from Go and Rust by kzrdude on Thursday July 11, 2013 @10:43AM (#6026302)
but the `break`/`return` syntactic sugar inside for-loop closures will be lost.
Re:Philosophy and "for" loops — more from Go and Rust by kibwen on Thursday July 11, 2013 @10:51AM (#6026362)
To be fair, it wasn't so much "syntactic sugar" as it was "a compiler hack that was rarely used and didn't even suffice for a large class of cases involving borrowed pointers".
Re:Philosophy and "for" loops — more from Go and Rust by dbaupp on Thursday July 11, 2013 @11:16AM (#6026533)
And, it is an incorrect compiler hack (https://github.com/mozilla/rust/issues/6675), but that's not saying much at the moment.
Re:Philosophy and "for" loops — more from Go and Rust by rntz on Thursday July 11, 2013 @10:47AM (#6026330)
Yes. You might be able to get something like it back with Rust's macro system, though. But it's probably better just to use the new syntax & iteration protocol, assuming the Rust folks come up with something reasonable.