Rust's for-loop construct probably changed
Rust's for-loop construct probably changed
Posted Jul 11, 2013 4:58 UTC (Thu) by eternaleye (guest, #67051)In reply to: Rust's for-loop construct probably changed by renox
Parent article: Philosophy and "for" loops — more from Go and Rust
Having read that article (and the sequel), there's one thing that bugs me a little about the tack Rust took. Rust *already* uses message-passing concurrency, and that allows a simple transformation from internal to external iterators by creating a stream, passing the chan into a task that runs the internal iterator (whose block closes over the chan), and then return or wrap an iterator for the port. So it startles me a bit that there isn't an Iterator implementation that does the transformation, yielding the best of both worlds.
