4 ms·
From a high level, iterators are basically just generators (which themselves are just simple continuations). Rust is a good example since pretty much all loopin
by _peeley 5y ago
From a high level, iterators are basically just generators (which themselves are just simple continuations). Rust is a good example since pretty much all looping is done via iterators, and most implementations of the Iterator[0] trait look similar to the examples in the article. If you squint hard, calling `iter.next()` in Rust is just like the Scheme example, where you're continuously calling the generator function to get the next value. So, the people who use Rust at their day job definitely use (a form of) continuations at their day jobs.
[0]: https://doc.rust-lang.org/std/iter/trait.Iterator.html https://doc.rust-lang.org/std/iter/trait.Iterator.html
- agumonkey 5y agoWell one could argue that any strucured process with more than one thing/node will embed a continuation to connect the two parts.