Personally I would have simplified its syntax a little bit more, if possible.
For instance, the following example code
main() {
sum := 0
for v in [5, 7, 11] index i //index is optional
{
if v == 11 { break }
sum += v
if sum > 20 { break }
print("$i: $v")
}
_OnBreak { //<-- must be immediately after loop
print("Index $i broke out of loop")
}
_OnComplete { //<-- Will not execute on break
print("Array is OK")
}
}
would have wrote it as follows: main() {
sum := 0
for v in [5, 7, 11] index i //index is optional
{
break if v == 11
sum += v
break if sum > 20
print("$i: $v")
}
_OnBreak :: print("Index $i broke out of loop") //<-- must be immediately after loop
_OnComplete :: print("Array is OK") //<-- Will not execute on break
}
I honestly like simple, well-written code that is easy to follow.