We should consider breaking out of a closure using some language syntax.
| Code Block |
|---|
[1, 2, 3].each {
println(it)
if (it == 2)
break
}
|
would print
| Code Block |
|---|
1 2 |
At the implementation level it could be that 'break' really just throws a ClosureBreakException which the each() method could catch to terminate the loop.
