dmd 1.046 and 2.031 releases

Nick Sabalausky a at a.a
Mon Jul 6 19:49:16 PDT 2009


"Walter Bright" <newshound1 at digitalmars.com> wrote in message 
news:h2u735$sn8$1 at digitalmars.com...
> grauzone wrote:
>> I oriented this on the syntax of array slices. Which work that way. Not 
>> inconsistent at all. It's also consistent with foreach(_; x..y).
>
> It would look consistent, but it would behave very differently. x..y for 
> foreach and slices is exclusive of the y, while case x..y is inclusive.
>

The current way has that inconsistency:

variable .. variable   // exclusive end
caseLabel .. caseLabel    // inclusive end

And yes, I know that's not how it's actually parsed, but that's how people 
visually parse it.

Ah the hell with it, I don't care any more: The *real* issue here is that 
the current switch, being based on C's, is horribly antiquated and what we 
really need is a comprehensive redesign incorporating some sort of 
generalized pattern matching. Like "case > 1, <= 10:" or something like 
Nemerle, or whatever. I don't care, as long as it doesn't continue to get 
trivialized as something that can be solved by tossing in a recycled ".." 
here, a recycled "final" there, etc. 




More information about the Digitalmars-d-announce mailing list