Copy Constructor DIP and implementation

Jonathan M Davis newsgroup.d at jmdavisprog.com
Mon Sep 17 22:29:09 UTC 2018


On Monday, September 17, 2018 2:53:42 PM MDT 12345swordy via Digitalmars-d-
announce wrote:
> On Tuesday, 11 September 2018 at 15:08:33 UTC, RazvanN wrote:
> > Hello everyone,
> >
> > I have finished writing the last details of the copy
> > constructor DIP[1] and also I have published the first
> > implementation [2]. As I wrongfully made a PR for the DIP queue
> > in the early stages of the development of the DIP, I want to
> > announce this way that the DIP is ready for the draft review
> > now. Those who are familiar with the compiler, please take a
> > look at the implementation and help me improve it!
> >
> > Thanks,
> > RazvanN
> >
> > [1] https://github.com/dlang/DIPs/pull/129
> > [2] https://github.com/dlang/dmd/pull/8688
>
> The only thing I object is adding yet another attribute to a
> already big bag of attributes. What's wrong with adding keywords?

Every keyword that gets added is one more word that can't be used for
identifiers, which we don't want to do without a really good reason, and in
this particular context, I don't see what it would buy you anyway. You'd
just end up not having to put @ in front of it - and then of course, that
word couldn't be used as an identifier anymore. So, overall, going with a
keyword over an attribute seems like a net negative.

IMHO, the core problem is that the DIP adds _anything_ that you have to mark
up copy constructors with. We should just have a -dip* flag as a transition
to deal with the theoretical breakage that @implicit is supposed to prevent
(as well as gives us a chance to kick the tires of the implementation a bit
first) and not do anything special to mark copy constructors aside from what
their parameters are.

- Jonathan M Davis





More information about the Digitalmars-d-announce mailing list