Re:Rust – A hard decision pays off
by lvass on Wednesday August 24, 2022 @01:43PM
(#32582993)
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?
[ Parent
| on HN ]
Re:Rust – A hard decision pays off
by steveklabnik on Wednesday August 24, 2022 @01:51PM
(#32583139)
Rust doesn't guarantee TCO and so recursion is a bit dicer than in many functional languages.
Re:Rust – A hard decision pays off
by throwaway894345 on Wednesday August 24, 2022 @03:27PM
(#32584522)
In addition to Steve's sibling comment, I'm responding narrowly to iterators versus for-loops. Recursion is out of scope.