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

The first version isn't what I'd write in a purely functional language either, a recursive version would be much saner. Isn't recursion idiomatic in rust?


Rust doesn't guarantee TCO and so recursion is a bit dicer than in many functional languages.


In addition to Steve's sibling comment, I'm responding narrowly to iterators versus for-loops. Recursion is out of scope.




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

Search: