Let's call it `then`
downs
default_357-line at yahoo.de
Mon Mar 31 22:54:27 PDT 2008
Jesse Phillips wrote:
> I haven't given it much thought, but I figured I'd let some other people
> look at it too.
>
> Switch statements are nice, many people hate having to use break; all the
> time, but I don't and am not interest in the debate. What I think is
> missing from a switch statement is a finally section. Most of the time I
> don't have a use for the fall-through feature of switch, but I do have a
> use for doing one or more things that are the same in every case.
>
> As I haven't given it a lot of thought I will leave out some constraint
> ideas, and just see other peoples thoughts. I don't think it would ruin
> compatibility of any sort (backwards or C).
This can be generalized.
I would ask to introduce the keyword "then" to indicate "this is run after the previous construct has successfully completed, executing at least one branch."
It could be applicable to [do/]while-loops as well as switches.
Finally is an already existing keyword, which could lead to problems with parsing.
--downs
More information about the Digitalmars-d
mailing list