Re:Rust, Lifetimes, and Collections
by haberman on Wednesday November 19, 2014 @01:31PM
(#8631701)
This is long with a lot of detail, but to me the key bit of information is: iterators (as expressed by Rust's Iterator trait) have some noticeable drawbacks. Notably, you can't delete while iterating.
However, a different abstraction called Cursors can accommodate this. I asked recently: "does this mean iterators are broken, or are iterators vs. cursors more of a fundamental tradeoff?" I got this very helpful answer in reply: http://www.reddit.com/r/rust/comments/2mkra1/impressions_aft...
However, a different abstraction called Cursors can accommodate this. I asked recently: "does this mean iterators are broken, or are iterators vs. cursors more of a fundamental tradeoff?" I got this very helpful answer in reply: http://www.reddit.com/r/rust/comments/2mkra1/impressions_aft...