break seen as a C archaism

Remi Forax forax at
Fri Mar 9 21:19:18 UTC 2018

Hi guys,
i've talked/do presentation to several people online and offline about the enhanced switch.

While the overall feedback is positive (or very positive), the usage of break as a local return from a case expression is seen as a bad decision.
For some people, it's just ugly, but they can live with that. For others, it elevates the status of break and break is seen as something wrong, an archaism from C. For one, we are "retarded" (it was in French but i think it's the right translation) because even C# do not use break :)

When i asked what we should do instead, the answer is either:
  1/ we should not allow block of codes in the expression switch but only expression
  2/ that we should use the lambda syntax with return, even if the semantics is different from the lambda semantics.

I do not like (1) because i think the expression switch will become useless but for (2) i think i was wrong to consider the semantics difference as something important.
So should we backup and re-use the lambda semantics instead of enhancing break ? 


More information about the amber-spec-experts mailing list