All right, all right! Interim decision regarding qualified Object methods

Christophe Travert travert at phare.normalesup.org
Thu Jul 12 01:21:42 PDT 2012


"Mehrdad" , dans le message (digitalmars.D:172012), a écrit :
> On Thursday, 12 July 2012 at 04:15:48 UTC, Andrei Alexandrescu 
> wrote:
>> Required reading prior to this: http://goo.gl/eXpuX
> 
> Referenced post (for context):
>>> The problem is not only in the constness of the argument, but 
>>> also in
> its purity, safety, and throwability (although the last two can be
> worked arround easily).
> 
> I think we're looking at the wrong problem here.
> 
> If we're trying to escape problems with 'const' Objects by 
> removing the members form Object entirely, that should be raising 
> a red flag with const, not with Object.

const has no problem. It is bitwise const, and it works like that.
Logical const is not implemented in D, but that is a separate issue.

The problem is to force people to use const, because bitwise const may 
not be suited for their problems. If opEquals and friends are const, 
then D forces people to use bitwise const, and that is the problem, that 
is largely widened by the fact that bitwise transitive const is 
particularly viral. But if we do not impose to implement any const 
methods, the problem disappear.


More information about the Digitalmars-d mailing list