DIP 1018--The Copy Constructor--Formal Review

Manu turkeyman at gmail.com
Sun Feb 24 21:02:48 UTC 2019


On Sun, Feb 24, 2019 at 2:50 AM Mike Parker via Digitalmars-d-announce
<digitalmars-d-announce at puremagic.com> wrote:
>
> Walter and Andrei have requested the Final Review round be
> dropped for DIP 1018, "The Copy Constructor", and have given it
> their formal approval. They consider copy constructors a critical
> feature for the language.
>
> Walter provided feedback on Razvan's implementation. When it
> reached a state with which he was satisfied, he gave the green
> light for acceptance.
>
> The DIP:
> https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1018.md
>
>
> The implementation:
> https://github.com/dlang/dmd/pull/8688

I mean like, my DIP was almost violently rejected, but in here there's
text like this:

"The parameter of the copy constructor is passed by a mutable
reference to the source object. This means that a call to the copy
constructor may legally modify the source object:"

I can't see how that could be seen in any way other than what might
reasonably be described as "a hole large enough to drive a truck
through"...

But anyway, that's pretty wild. I think there's a clear pattern we've
been seeing here with practically every lifetime management DIP, and
also in general for forever, is that D's `const` just fundamentally
doesn't work. Couple this with the prevailing wisdom which is to
recommend that people "don't use const, because you can't write
programs and use const"

I think we need to throw in the towel, C++'s const is right, and D's
const is just wrong, and no amount of pretending that's not true will
resolve the endless stream of issues.
Where's the DIP to migrate to C++-style const? That is the predicate
for basically every important development I've seen lately...
including this one.


More information about the Digitalmars-d-announce mailing list