Switch-case made less buggy, now with PATCH!

Don nospam at nospam.com
Sun Nov 22 16:32:50 PST 2009


Chad J wrote:
> Don wrote:
>> Chad J wrote:
>>> Sorry I didn't know about Andrei's proposal.  Buried in the NG.
>> I'm surprised about that. It's what all the recent posts were based on!
>>
> 
> Now I'm confused.
> 
> http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=101110
> 
> The recent posts were in a thread that *I* started.
> 
> Andrei was the first one in on the action:
> 
> Andrei Alexandrescu wrote:
>> Chad J wrote:
>>> So, switch-case statements are a frequent source of nasty bugs.  Fixing
>>> them (well) requires breaking backwards compatibility.
>>>
>>> Any chance this will happen for D2?
>>>
>>> (This is intended as more of a reminder and simple curiosity than a
>>> discussion.)
>> I wish very much that a transferring control flow statement (break,
>> return, goto etc.) is required at the end of each case. Then, the rare
>> case when you want to break through is easy to implement as goto case
>> xxx; and all is good.
>>
>> Walter's answer to that has put me to silence for good. "But I use
>> fall-through all the time!" I then knew the feature will never make it.
>>
>>
>> Andrei
> 
> Agreeable words indeed, but not terribly detailed.  I have to imagine
> you and I are looking at different things.

You're right. I think he reiterated it somewhere in that thread though. 
But there's been a lot of traffic recently.

> 
>>> Why didn't you just say that Andrei made another proposal and that
>>> you're peeved I didn't use it?
>> I'm not peeved.
>>
> 
> "You've done a patch which completely ignores his proposal, and which
> violates both. "
> 
> "completely ignores" and "violates".  Strong words.  Ya coulda fooled me.

That's only because I had to say the same thing about three different 
times to try to get you to understand what's wrong with it.
Introducing new syntax that has never been discussed is GUARANTEED to 
get a patch rejected. Your original patch broke all the rules, quite 
unnecessarily.

 > There's nothing wrong with being peeved ;)

I was just doing you a favour by telling you how to write a patch that's 
more likely to be accepted. I don't have any personal feelings about the 
issue or the patch, just sick of wasting my time on something so 
unimportant.





More information about the Digitalmars-d mailing list