"with" still sucks + removing features + adding features
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Mon May 18 21:09:21 PDT 2009
Georg Wrede wrote:
> Rainer Deyke wrote:
>> Andrei Alexandrescu wrote:
>>> Even Perl would turn its nose at a significant semantic difference
>>> brought by the third period.
>>
>> Not true: Perl has a '..' operator and a '...' operator with distinct
>> but similar meanings. And as much as I loathe Perl in general, I don't
>> see anything wrong with that. I am open to a reasonable alternate
>> syntax.
>
> Having both .. and ... wouldn't be too bad. They're insistinguishable
> only as long as one is not expecting a distinction. But with a
> programming language, they look dissimilar enough.
>
> A side benefit would be to be able to specify inclusive and exclusive
> ranges both within switch statements and range contexts.
>
> '0' ... '9'
> 'a' ... 'z'
> a .. b
> a ... b
> 0 .. middle
> middle .. $
>
> Of course, this idea will be drowned in a 2-month bicycle shed color
> discussion about which should be the inclusive range and which the
> exclusive one. And after that somebody suggests tokens for the remaining
> two inclusion permutations, and then we really can forget all this for
> good.
I'm now sorry I even mentioned the blessed thing. This must have been
the worst discussion on language design, ever.
Andrei
More information about the Digitalmars-d
mailing list