News for hackers. Stuff that matters.
Re:Philosophy and "for" loops — more from Go and Rust by anonymous on Thursday July 11, 2013 @01:11PM (#6027404)
That is basically a while loop without a "proper body", right? At each iteration advance is called with the closure as first argument and iteration continues until it returns false?
Re:Philosophy and "for" loops — more from Go and Rust by kibwen on Thursday July 11, 2013 @02:24PM (#6028038)
You're correct. You can see as much here in the implementation of `advance` (as you'd expect, it's very simple):

https://github.com/mozilla/rust/blob/master/src/libstd/itera...