Hacker News new | past | comments | ask | show | jobs | submit login

That's the nicest counter-example to my example, thanks for that! I wasn't familiar with take_while() (looks like that's Rust, and looks like Python has a similar itertools.takewhile() ), TIL a neat FP version of break. My example was quite trivial, it's not always so obvious how to break up a convoluted loop, but it should always be possible.



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

Search: