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

> Personally, I like Rust’s extensive iterator functions even better than Python’s

Funny, when the rust example that gave rise to the comment looks more or less like Ruby[ * ] but with other syntax for blocks. The writer should get around more and try more other languages.

[ * ] Or any of a zillion other object oriented languages that have decent support for functional looking code.



My understanding, though, is that idiomatic Ruby inverts the control for iteration (array.each(|thing| do stuff)), which leads to slightly different ergonomics, whereas idiomatic Python is like what Rust is now; see http://journal.stuffwithstuff.com/2013/01/13/iteration-insid... for a comparison. Interestingly, Rust used to have iteration styled after Ruby's, and explicitly switched in rust 0.7: https://www.reddit.com/r/programming/comments/1hl2qr/rust_07...

I think the comparison here is also to Python because the specifics of the API, rather than just the patterns, are pretty obviously inspired specifically by Python (names of functions like zip, etc.), as opposed to other external-iterator languages like C#




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

Search: