What happens if the loop body does not assign to the result variable? What if the condition is false before entering the loop?
I think it would have been cleaner to pass the value the loop should return to a break primitive and otherwise compute it in a dedicated block.