3 ms·
Yeah, I'm aware of the other options, just pointing that the use of lambdas break the flow.
by mamcx 5y ago
Yeah, I'm aware of the other options, just pointing that the use of lambdas break the flow.
- emi2k01 5y agoRust just standardized `ControlFlow` which would let you pass equivalents of `break` and `continue` as values. x.try_for_each(|y| {...; ControlFlow::Break} )
- mamcx 5y agoYeah, that is cool, and also show the problem :). Internal iterators and/or lambdas are at odds with imperative code. Some guy also yesterday ponder about this stuff: https://www.reddit.com/r/ProgrammingLanguages/comments/pno38l/what_would_a_principled_imperative_language_look/ https://www.reddit.com/r/ProgrammingLanguages/comments/pno38...