dmd 1.046 and 2.031 releases
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Mon Jul 6 12:42:12 PDT 2009
Derek Parnell wrote:
> On Mon, 06 Jul 2009 13:47:44 -0500, Andrei Alexandrescu wrote:
>
>> Chad J wrote:
>>> Walter Bright wrote:
>>>> grauzone wrote:
>>>>> No. Also, this final switch feature seems to be only marginally
>>>>> useful, and normal switch statements do the same, just at runtime. So
>>>>> much for "more pressing issues" but it's his language and not mine so
>>>>> I'll shut up.
>>>> The final switch deals with a problem where you add an enum member in
>>>> one file and then have to find and update every switch statement that
>>>> uses that enum. There's no straightforward way to find them to ensure
>>>> the case gets added to each switch.
>>>>
>>>> It's solving a similar problem that symbolic constants do.
>>>>
>>>>
>>>> The fall-through thing, though, is purely local and so much less of an
>>>> issue.
>>> huh?
>>>
>>> These bugs always take me no less than 2 hours to find, unless I am
>>> specifically looking for fall-through bugs.
>> I agree. Probably a good option would be to keep on requiring break, but
>> also requiring the user to explicitly specify they want fallthrough in
>> the rare case when they do want it. I'd love to use "continue" for that
>> but it's already "occupied" by cases like while (...) switch (...).
>> Requiring !break or ~break would work but is a bit too cute. Adding a
>> new keyword or a whole new switch statement is too much aggravation. I
>> guess we'll have to live with it...
>
> "too much aggravation" for whom? Certainly not for the coder, IMO.
>
> Consider this syntax suggestion ...
[snip]
Well, I think I'd call that aggravation.
Andrei
More information about the Digitalmars-d-announce
mailing list