July 07, 2009
"Daniel Keep" <daniel.keep.lists@gmail.com> wrote in message news:h2usvm$e9r$1@digitalmars.com...
>
> This community has a horrible tendency to become focused on bike-shed issues and I really, really don't want to see this particular one start up all over again.
>

If you have a problem with bikeshed discussions, wouldn't it make more sense not to participate in them instead of continually whining about them?


July 07, 2009
"Tim Matthews" <tim.matthews7@gmail.com> wrote in message news:h2v0ng$ko8$1@digitalmars.com...
>>
>> b) "(1,3)" already means two things, neither of which has anything to do
>
> Could you kindly state those?
>
> I can see that just having "(1,3)" preceded with the "case" keyword makes most other meanings impossible.

One is a function paramater list. Someone else said it's also an expression that evaluates to 3, but that seems beyond useless to me.


July 07, 2009
Nick Sabalausky wrote:
> "Tim Matthews" <tim.matthews7@gmail.com> wrote in message news:h2v0ng$ko8$1@digitalmars.com...
>>> b) "(1,3)" already means two things, neither of which has anything to do
>> Could you kindly state those?
>>
>> I can see that just having "(1,3)" preceded with the "case" keyword makes most other meanings impossible.
> 
> One is a function paramater list. Someone else said it's also an expression that evaluates to 3, but that seems beyond useless to me. 
> 
> 

Neither. Functions can't be named case and expressions with no effect must be cast to void.
July 07, 2009
On Tue, 07 Jul 2009 04:35:56 -0400, Mike James wrote:

> 
> Or you introduce a new keyword :-)

Ooooh .... you said the 'k' word, naughty boy.

-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
July 07, 2009
"Tim Matthews" <tim.matthews7@gmail.com> wrote in message news:h2v4pa$qde$1@digitalmars.com...
> Nick Sabalausky wrote:
>> "Tim Matthews" <tim.matthews7@gmail.com> wrote in message news:h2v0ng$ko8$1@digitalmars.com...
>>>> b) "(1,3)" already means two things, neither of which has anything to do
>>> Could you kindly state those?
>>>
>>> I can see that just having "(1,3)" preceded with the "case" keyword makes most other meanings impossible.
>>
>> One is a function paramater list. Someone else said it's also an expression that evaluates to 3, but that seems beyond useless to me.
>
> Neither. Functions can't be named case and expressions with no effect must be cast to void.

Huh? I think we got out-of-sync when I accidentially quoted more than I meant to. I was responding specifically to "(1,3) already means two things...Could you kindly state those?"


July 07, 2009
Derek Parnell Wrote:

> On Tue, 07 Jul 2009 04:35:56 -0400, Mike James wrote:
> 
> > 
> > Or you introduce a new keyword :-)
> 
> Ooooh .... you said the 'k' word, naughty boy.
> 
> -- 
> Derek Parnell
> Melbourne, Australia
> skype: derek.j.parnell

It's my Pascal background - why use a hieroglyphic when an English word will do :-)

-=mike=-
July 07, 2009
Daniel Keep escribió:
> Andrei Alexandrescu wrote:
>> I swear if I didn't know anything about the feature and saw the syntax
>> "case a: .. case b:" I'd know exactly what it does in a millisecond. Why
>> would the syntax seem inconsistent to new D users? First of all,
>> inconsistent with what? And how would you treat the issue differently?
>>
>>
>> Andrei
> 
> I think something that might help is if you started using the syntax
> like this:
> 
>> case a:
>> ..
>> case b:
>>     blah
> 
> Now it's clear that it represents a sequence of case labels where all
> but the first and last have been elided VERSUS representing a case label
> where the label is a range.

That's nice!

I'll make Descent format code like that.

And NO, you won't be able to change that, and it will format it when you are typing, and you won't be able to change it's form even if you wanted.




Nah, just kidding.
July 07, 2009
Daniel Keep wrote:
> Andrei Alexandrescu wrote:
>> I swear if I didn't know anything about the feature and saw the syntax
>> "case a: .. case b:" I'd know exactly what it does in a millisecond. Why
>> would the syntax seem inconsistent to new D users? First of all,
>> inconsistent with what? And how would you treat the issue differently?
>>
>>
>> Andrei
> 
> I think something that might help is if you started using the syntax
> like this:
> 
>> case a:
>> ..
>> case b:
>>     blah
> 
> Now it's clear that it represents a sequence of case labels where all
> but the first and last have been elided VERSUS representing a case label
> where the label is a range.
> 
> I get the sneaking suspicion that the major problem people have with the
> syntax is that when you write "case a: .. case b:" all on one line, they
> treat it as the latter when they should be thinking in terms of the
> former; the various suggestions that have been made would seem to
> support this.

I've been keeping quiet on the subject to see how it plays out... Now I've seen it written like this I'm sold! :D
July 07, 2009
On Tue, Jul 7, 2009 at 5:24 PM, Tim Matthews<tim.matthews7@gmail.com> wrote:
> Andrei Alexandrescu wrote:
>>
>> Existing actual or perceived inconsistencies are not an argument for adding more of them.
>>
>
> Seriously?

d00d.  Does that really need explanation?  Two wrongs don't make a right is all he's saying.  Do you disagree?


>> a) It is not arguably better and more suggestive than the syntax in place.
>
> I can't guarantee that it's better but I do think an argument can prove a result. Thats what arguments for.

But the argument has already been had previously here on the NG.  I guess you missed it.


>> b) "(1,3)" already means two things, neither of which has anything to do
>
> Could you kindly state those?
>
> I can see that just having "(1,3)" preceded with the "case" keyword makes most other meanings impossible.

Unless you have been told what it means, people seeing it for the first time will probably not guess that it means a range.  It looks like a case list to me that would only stop on case 1 or case 3.   We already have the syntax  "case 1,3:" so just adding parentheses to that doesn't really scream out "range".

--bb
July 07, 2009
Tim Matthews wrote:
> Andrei Alexandrescu wrote:
>>
>> Existing actual or perceived inconsistencies are not an argument for adding more of them.
>>
> 
> Seriously?
> 
>>
>> a) It is not arguably better and more suggestive than the syntax in place.
> 
> I can't guarantee that it's better but I do think an argument can prove a result. Thats what arguments for.
> 
>>
>> b) "(1,3)" already means two things, neither of which has anything to do 
> 
> Could you kindly state those?

(1, 2) is an expression and the argument list for a function. Neither suggests in the least that it's supposed to mean a sequence of case labels.

> I can see that just having "(1,3)" preceded with the "case" keyword makes most other meanings impossible.

Prepare to be surprised. Compile this:

void main()
{
    switch (2)
    {
    case (1, 2): break;
    default: break;
    }
}


Andrei