Named blocks #10
Labels
feature
This issue is related to implementing a major feature of the compiler.
language feature
Adding a new feature into the language.
Because the language lacks
goto
, breaking out of a nested loop is quite unreadable:Therefore, I think that named blocks should be introduced:
Reasoning behind the syntax:
block <name>
andbreak @<name>
instead of<name>:
andbreak <name>
block
should be an expression, thus one should be able to return a value out of a block.break @loops -1
looks maybe just a little weird? Especially when combined with some more complex expression likebreak @loops x + y * 2
with
keyword between the label and the result expression:break @loops with x + y * 2
@label
already separates the label name from the expression, especially if it's highlighted differently from normal expressions in editors.The text was updated successfully, but these errors were encountered: