Two possibilities (but I’m not entirely sure how much sense they make):
- Use a keyword that enables custom break and continue (problem: "for" clashes
with iterators):
for mycollection.each({ | x | if (x === 0) break })
- Standardize a BreakException. Then breaking isn’t the loop’s responsibility,
any more. `continue` as an early return seems less important, because you can
use break as follows:
mycoll.forEach { | x |
block: {
if (x < 0) {
break block; // "continue"
}
// do more with x here
}
}
--
Dr. Axel Rauschmayer
[email protected]
home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss