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

deadalnix deadalnix at gmail.com
Thu Jul 12 14:44:58 PDT 2012


On 12/07/2012 21:27, Jonathan M Davis wrote:
> On Thursday, July 12, 2012 20:42:49 David Piepgrass wrote:
>> - 'const' is not overly harsh if the user has machanisms to make
>> that mean 'logical const'.
>
> That will _never_ happen. That completely destroys a number of the benefits of
> const, and it adds quite a bit of cognitive load in dealing with const,
> because all of a sudden, you have to worry about whether _this_ const means
> actual const or logical const. It would also complicate the compiler's
> handling of const by quite a bit. Not to mention, Walter hates logical const
> in general, so he wouldn't support it. So, no, it's not going to happen.
>
> If we get any kind of logical const, it's going to be separate from const.
> const always has been and always will be physical const in D.
>
> - Jonathan M Davis

This has been discussed and isn't as dumb as you may think. What is 
important for us is that const provide the guarantee to never mutate 
immutable data.

Expressed that way, it can be loosened is some cases, in such a way that 
immutable data can never mutate throw const, but mutable one could.

I'm not for or against that, but it is certainly something to keep in 
mind when facing language evolution. We have that door ready to open.


More information about the Digitalmars-d mailing list