Let's call it `then` - STUPID
downs
default_357-line at yahoo.de
Mon Mar 31 23:00:51 PDT 2008
downs wrote:
> 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
I am stupid. If the OP was an april fools, I fell for it hook, line and sinker.
I had completely forgotten that switch already covers all cases.
Ignore this keyword for switches please, folks.
(I still think it's a good idea for loops)
--downs
More information about the Digitalmars-d
mailing list