I find the code much easier to comprehend that way. Also, I don't know how you can write nested comprehensions with map and filter.
Also, with map and filter you have to give names to variables both for map and for filter. Contrast: [name for name. age in zip(names, ages) if age > 30] with zip(names, ages).filter(|name, age| age > 30).map(|name, age| name) See http://en.wikipedia.org/wiki/List_comprehension - a lot of languages have list comprehensions. They're really useful. On 13 June 2013 19:44, Ziad Hatahet <[email protected]> wrote: > Shouldn't we just be able to use map() and filter() routines to do the > same? > > -- > Ziad > >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
