Another syntactic under-performer

Bill Baxter wbaxter at gmail.com
Tue Oct 14 01:32:34 PDT 2008


On Tue, Oct 14, 2008 at 5:25 PM, Bill Baxter <wbaxter at gmail.com> wrote:
> On Tue, Oct 14, 2008 at 5:19 PM, ore-sama <spam at here.lot> wrote:
>> Bill Baxter Wrote:
>>
>>> > http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=77141
>>> >
>>>
>>> I saw the thread.   Like some others, I didn't really get the need for
>>> that particular change.
>>> I'd give it another look right now, but unfortunately links to that
>>> web-news interface don't work right. :-(  That link goes to an
>>> unrelated discussion.
>>>
>>> --bb
>>
>> script has problem with art_group parameter, edit it manually to hold real group name:
>> art_group=digitalmars.D
>> art_group=digitalmars.D.announce
>> art_group=digitalmars.D.learn
>
> Oh wait.. that was the right post.  It was just #4 out of 4 points.
> Sorry I just missed it.

The proposal was this:

"""
4. Replace C-style switch with something modern and more D-like:

switch (x)
{
    case (0) foo();
    case (1)
    {
        bar();
        baz();
    }
    else throw new Exception("nope");
}
"""

The question is why?  Replacing syntax just to look "more modern" is
not a good justification for breaking everyone's code.

But if you have the goal of freeing up the colon for bigger and better
things, I suppose that doesn't seem like a bad syntax.   I don't think
it would kill the Duff's device, either.  It's just a different syntax
for the current switch.


Excuse me now.. while I "free up my colon for bigger and better things".

--bb



More information about the Digitalmars-d mailing list