Congratulations to the D Team!

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Jul 11 05:39:03 PDT 2012


On 7/10/12 10:59 PM, Jakob Ovrum wrote:
> On Wednesday, 11 July 2012 at 02:02:52 UTC, Andrei Alexandrescu wrote:
>> On 7/10/12 9:45 PM, Timon Gehr wrote:
>>> I do not desire logical const as a language feature. But conservative
>>> type systems are not good for everything. The root of the class
>>> hierarchy needs to be good for everything. Object is not an adequate
>>> root any more.
>>
>> How about we consider just stiffening that upper lip and implement
>> comparison and hashing without modifying their target?
>>
>> Andrei
>
> It's more likely to go down like this: programmer attempts to write his
> opEquals (or toString etc) within the restrictions of const, but fails
> due to the requirements of the implementation (which can easily go
> beyond simple performance measures like caching, as demonstrated). The
> programmer then writes his own mutable member function and neglects
> opEquals altogether. If the programmer is real nice, he/she will write a
> throwing opEquals stub.

I gave evidence on a large, high quality C++ codebase that the use of 
mutable (which is the solution of choice for memoization, caching, and 
lazy computation) is extremely scarce.

What evidence do you have for your prediction?


Andrei


More information about the Digitalmars-d mailing list