Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It has 'iterators' which are like Python generator objects (and are used in for-loops, just like Python's), but it doesn't have generator comprehensions or generator functions.

It's definitely possible in a strongly, statically-typed language (I believe C#'s async/await is an example), but Rust doesn't do it... yet: https://github.com/rust-lang/rfcs/issues/388



An iterator comprehension can be hacked together, it's just a different syntax to use a few iterator adaptors together.

http://bluss.github.io/rust-itertools/doc/itertools/macro.ic...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: