grauzone wrote:
You are just saying it's ugly. I don't think it's ugly. Walter doesn't
think it's ugly. Other people don't think it's ugly. Many of the
people who said it's ugly actually came up with proposals that are
arguably ugly, hopelessly confusing, or both. Look at only some of the
rehashed proposals of today: the genial "case [0 .. 10]:" which is
horribly inconsistent, and the awesome "case 0: ... case 10:", also
inconsistent (and gratuitously so) because ellipses today only end
lists without having something to their right. The authors claim those
are better than the current syntax, and one even claimed "beauty",
completely ignoring the utter lack of consistency with the rest of the
language. I don't
I oriented this on the syntax of array slices. Which work that way.
No, it works differently because the slice is open to the right, whereas
with switch one seldom wants to specify an open range.
Not
inconsistent at all. It's also consistent with foreach(_; x..y).
No, it isn't consistent. It's a lose-lose proposition. If you want to
make it consistent you'd need to have ['a' .. 'z'] exclude the 'z'. That
would confuse people who expect ['a' .. 'z'] to contain 'z'. On the
other hand, if you choose to include 'z' you will confuse people who
expect behavior to be similar with that in arrays.
Going with a syntax that uses ".." just as punctuation but otherwise
firmly departs from the slice notation eliminates expectation of
semantic similarity. And the presence of the second "case" firmly
clarifies that the last label is to be included in the range, even to
the first-time reader. There would be seldom a need to check the manual
for that.
Other than that, I realize it's not that good of a choice and it's not
elegant at all. But I think it's still better than some of your horrible
language crimes (including yours) that are being forced into D.
Thanks for emphasizing twice that it's about me. Yep, they're my
horrible language crimes - and those definitely include mine :o). I
genuinely appreciate the honesty, and to reciprocate, I don't think very
highly of your competence either (as every other post of yours makes
some technical mistake), and I find your attitude corrosive.
Andrei