‘if’ is the filter for the exit point : exit iff true.
Usage : inside ‘loop’ block
loop {
break if x > y;
// equivalent to js : while (x > y) {… }
…
}
loop {
…
// equivalent to js : do{ … } while (x > y);
break if x > y;
}
loop {
…
// see ada-lang : ‘exit when’ syntax for an equivalent.
// 2 or more can be placed anywhere in the the loop, scattered or not.
break if x > y;
…
}
Note : that is a lot of flexibility and expressive powess.
Yet the rust core team keeps it from us ??
Please correct the wrong ??
when teaching the branching concept to school students,
leaving one component out is a disservice. they need complete
understanding and practice of the concept.
that is a very arbitrary distinction to make, there's no real difference between the two constructs - you seem to be suggesting that the design of the AST is important for a beginner to the language. Are you sure you're not just arguing for this syntax because it reads more like natural language?