D Development Paradigm
James Dennett
jdennett at acm.org
Wed Dec 19 22:16:10 PST 2007
Walter Bright wrote:
> Jesse Phillips wrote:
>> I would like to point out string, which was very much detested, but it
>> is finally here. However string is not just an alias to char[] and it
>> is not the String class that was wanted, but instead an alias to a
>> const(char[]) something useful in the face of const I suppose.
>
> I'll often resist an idea because the existing implementations in other
> languages suck. I'd rather delay implementing it until a non-sucking
> design can be found. C++ const is a classic example of that. C++ const
> is a first generation design, and has two crippling shortcomings: no
> invariant, and no transitivity.
C++ const has a form of transitivity: if an object A is const,
and A contains an object B, then B is also const (and so on
recursively).
Mercifully that doesn't apply to objects merely associated
with A.
> C++ const was leading edge technology when it was designed, but it's
> obsolete today.
Reality shows otherwise, for many reasons.
> Only time will tell if D's const sucks or not :-)
We'll have to see what it looks like when the dust settles. (Now,
a framework for user-extensible qualifiers would be quite something
if it could be done well. I imagine Andrei might have opinions
there too.)
-- James
More information about the Digitalmars-d
mailing list