www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Review of DIP53

reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
http://wiki.dlang.org/DIP53

There are quite a few similarities with DIP49 so I won't discuss the 
shared parts. In fact my only comment is that I'm unclear on the 
motivation and the progress marked by this DIP (i.e. assuming it's 
implemented to perfection, it would make D better because...). One 
argument is that "current definition is very complex and hard to 
understand" but DIP53 doesn't seem to make matters any simpler.

What adds to the confusion is that some rules already work today so it's 
unclear what's already there and where the changes are.

Overall, I'm not clear what DIP53 does. It may only be a matter of the 
writeup itself. Also I'll note that there might be subtleties of current 
constructors I'm inadvertently glossing over.


Andrei
Feb 02 2014
next sibling parent reply Timon Gehr <timon.gehr gmx.ch> writes:
On 02/03/2014 01:58 AM, Andrei Alexandrescu wrote:
 Overall, I'm not clear what DIP53 does.

It removes the concept of const constructors and inout constructors from the language. The old const constructor syntax is then used to introduce a new feature that is very similar to inout constructors (the unique constructor) but requires special type checking rules for const-qualified data. It mostly removes features. Eg, the following code will break: auto foo(const(int)[] x){ struct S{ int[] x; this(int y)const{ this.x=x; } } // ... } Some new code that wouldn't have been possible to write in an analogous way before: struct S{ int x; int[] y; this(int delegate(inout(int)[]) dg, inout(int)[] x)const{ this.x=dg(x); this.y=[this.x]; } } void main(){ immutable s = S(x=>x[0],[1]); auto s = S((immutable x)=>x[0],cast(immutable)[2]); } Whatever strange class of new use cases DIP53 actually enables is fully covered by multiple inout-qualifiers as discussed in my previous post.
Feb 02 2014
parent Timon Gehr <timon.gehr gmx.ch> writes:
On 02/03/2014 02:18 AM, Timon Gehr wrote:
 It removes the concept of const constructors and inout constructors from
 the language.  ...

Apparently my memory was failing me. inout constructors actually stay as they are, but the examples I gave are still valid.
Feb 02 2014
prev sibling next sibling parent "deadalnix" <deadalnix gmail.com> writes:
On Monday, 3 February 2014 at 00:58:55 UTC, Andrei Alexandrescu 
wrote:
 Overall, I'm not clear what DIP53 does.

It tries to reinvent isolated, poorly.
Feb 02 2014
prev sibling parent Kenji Hara <k.hara.pg gmail.com> writes:
--001a11c22590145d0004f1813573
Content-Type: text/plain; charset=UTF-8

2014-02-03 Andrei Alexandrescu <SeeWebsiteForEmail erdani.org>:

 http://wiki.dlang.org/DIP53

 There are quite a few similarities with DIP49 so I won't discuss the
 shared parts. In fact my only comment is that I'm unclear on the motivation
 and the progress marked by this DIP (i.e. assuming it's implemented to
 perfection, it would make D better because...). One argument is that
 "current definition is very complex and hard to understand" but DIP53
 doesn't seem to make matters any simpler.

 What adds to the confusion is that some rules already work today so it's
 unclear what's already there and where the changes are.

 Overall, I'm not clear what DIP53 does. It may only be a matter of the
 writeup itself. Also I'll note that there might be subtleties of current
 constructors I'm inadvertently glossing over.

Please read "Motivation" section. Currently implemented and documented "unique constructor" feature is too hard to understand. and it is not consistent with DIP49. So if DIP49 is accepted, I strongly recommend to accept also DIP53. Kenji Hara --001a11c22590145d0004f1813573 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">2014= -02-03 Andrei Alexandrescu <span dir=3D"ltr">&lt;<a href=3D"mailto:SeeWebsi= teForEmail erdani.org" target=3D"_blank">SeeWebsiteForEmail erdani.org</a>&= gt;</span>:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-= left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p= adding-left:1ex"><a href=3D"http://wiki.dlang.org/DIP53" target=3D"_blank">= http://wiki.dlang.org/DIP53</a><br> <br> There are quite a few similarities with DIP49 so I won&#39;t discuss the sh= ared parts. In fact my only comment is that I&#39;m unclear on the motivati= on and the progress marked by this DIP (i.e. assuming it&#39;s implemented = to perfection, it would make D better because...). One argument is that &qu= ot;current definition is very complex and hard to understand&quot; but DIP5= 3 doesn&#39;t seem to make matters any simpler.<br> <br> What adds to the confusion is that some rules already work today so it&#39;= s unclear what&#39;s already there and where the changes are.<br> <br> Overall, I&#39;m not clear what DIP53 does. It may only be a matter of the = writeup itself. Also I&#39;ll note that there might be subtleties of curren= t constructors I&#39;m inadvertently glossing over.</blockquote><div><br> </div><div><div>Please read &quot;Motivation&quot; section.</div><div>Curre= ntly implemented and documented &quot;unique constructor&quot; feature is t= oo hard to understand. and it is not consistent with DIP49. So if DIP49 is = accepted, I strongly recommend to accept also DIP53.</div> </div><div><br></div><div>Kenji Hara</div></div></div></div> --001a11c22590145d0004f1813573--
Feb 03 2014