3 ms·
Some languages support early return(break) and labeled return (continue) in lambdas. Although good languages have lazy iterators or optimizing compilers. One wo
by FromTheSteppe 4y ago
Some languages support early return(break) and labeled return (continue) in lambdas. Although good languages have lazy iterators or optimizing compilers. One would use iterator.takeWhile(x => x is not m) in your case, or filter, and skip in other cases. Better languages even allow you to yield return and write your own lazy iterator transformations.