Re: DIP49 - Define qualified postblit

2013-11-17 Thread Jonathan M Davis
On Tuesday, November 12, 2013 13:30:49 Kenji Hara wrote: > 2013/11/11 Daniel Davidson > > > From this thread (http://forum.dlang.org/post/mailman.89.1383248384.9546. > > digitalmars-d-le...@puremagic.com) I was under the impression that > > const/immutable and postblits don't mix. This DIP seems

Re: DIP49 - Define qualified postblit

2013-11-11 Thread Andrei Alexandrescu
On 11/11/13 8:30 PM, Kenji Hara wrote: 2013/11/11 Daniel Davidson mailto:nos...@spam.com>> >From this thread (http://forum.dlang.org/post/__mailman.89.1383248384.9546.__digitalmars-d-learn@puremagic.__com

Re: DIP49 - Define qualified postblit

2013-11-11 Thread Kenji Hara
2013/11/11 Marco Leise > Am Sun, 10 Nov 2013 21:03:34 +0900 > schrieb Kenji Hara : > > > So, separating "inout postblit' and 'unique postblit' may be reasonable. > > > > (However, it seems to me that the syntax "this(inout this) inout;" looks > > weird... > > > > Kenji Hara > > I see the value in

Re: DIP49 - Define qualified postblit

2013-11-11 Thread Kenji Hara
2013/11/11 Daniel Davidson > From this thread (http://forum.dlang.org/post/mailman.89.1383248384.9546. > digitalmars-d-le...@puremagic.com) I was under the impression that > const/immutable and postblits don't mix. This DIP seems to be trying to > address that. One of the potential workarounds to

Re: DIP49 - Define qualified postblit

2013-11-11 Thread Kenji Hara
2013/11/10 Daniel Murphy > > "Kenji Hara" wrote in message > news:mailman.339.1384090714.9546.digitalmar...@puremagic.com... > > 2013/11/10 Daniel Murphy > > > >> "Kenji Hara" wrote in message > >> news:mailman.336.1384083327.9546.digitalmar...@puremagic.com... > >> > > >> > This is valid. Bec

Re: DIP49 - Define qualified postblit

2013-11-10 Thread Marco Leise
Am Sun, 10 Nov 2013 21:03:34 +0900 schrieb Kenji Hara : > So, separating "inout postblit' and 'unique postblit' may be reasonable. > > (However, it seems to me that the syntax "this(inout this) inout;" looks > weird... > > Kenji Hara I see the value in DIP49. There is a hole in the type system

Re: DIP49 - Define qualified postblit

2013-11-10 Thread Timon Gehr
On 11/10/2013 04:41 PM, Daniel Davidson wrote: With this proposal, is there still a need for struct copy constructors? No.

Re: DIP49 - Define qualified postblit

2013-11-10 Thread Daniel Davidson
On Sunday, 10 November 2013 at 13:46:20 UTC, Kenji Hara wrote: 2013/11/10 Daniel Davidson With this design, is there no need then for struct constructors - or would this be orthogonal or in addition to those? Currently "constructing unique object" is already supported. http://dlang.org/c

Re: DIP49 - Define qualified postblit

2013-11-10 Thread Daniel Murphy
"Kenji Hara" wrote in message news:mailman.339.1384090714.9546.digitalmar...@puremagic.com... > 2013/11/10 Daniel Murphy > >> "Kenji Hara" wrote in message >> news:mailman.336.1384083327.9546.digitalmar...@puremagic.com... >> > >> > This is valid. Because not only strongly pure function will r

Re: DIP49 - Define qualified postblit

2013-11-10 Thread Kenji Hara
2013/11/10 Daniel Davidson > On Sunday, 10 November 2013 at 06:46:47 UTC, Kenji Hara wrote: > >> http://wiki.dlang.org/DIP49 >> >> Experimental compiler/druntime patches (WIP, 80% completed): >> https://github.com/9rnsr/dmd/tree/qual_pblit >> https://github.com/9rnsr/druntime/tree/qual_pblit >> >

Re: DIP49 - Define qualified postblit

2013-11-10 Thread Kenji Hara
2013/11/10 Daniel Murphy > "Kenji Hara" wrote in message > news:mailman.336.1384083327.9546.digitalmar...@puremagic.com... > > > > This is valid. Because not only strongly pure function will return unique > > object. > > > > For example: > > immutable(int)[] foo(int[] iarr) pure { ... } > > in

Re: DIP49 - Define qualified postblit

2013-11-10 Thread Daniel Davidson
On Sunday, 10 November 2013 at 06:46:47 UTC, Kenji Hara wrote: http://wiki.dlang.org/DIP49 Experimental compiler/druntime patches (WIP, 80% completed): https://github.com/9rnsr/dmd/tree/qual_pblit https://github.com/9rnsr/druntime/tree/qual_pblit Kenji Hara Does the analysis hold up the same

Re: DIP49 - Define qualified postblit

2013-11-10 Thread Daniel Murphy
"Kenji Hara" wrote in message news:mailman.336.1384083327.9546.digitalmar...@puremagic.com... > > This is valid. Because not only strongly pure function will return unique > object. > > For example: > immutable(int)[] foo(int[] iarr) pure { ... } > int[] marr = foo([1,2,3]); > // foo will neve

Re: DIP49 - Define qualified postblit

2013-11-10 Thread Kenji Hara
2013/11/10 Timon Gehr > On 11/10/2013 12:07 PM, Kenji Hara wrote: > >> Condider a case that copying "inout struct" inside inout function. >> >> struct S { >> int[] arr; >> this(this) ??? { } >> } >> int[] foo(inout S src) >> { >> S dst = src; // copy inout S to S >> return dst

Re: DIP49 - Define qualified postblit

2013-11-10 Thread Timon Gehr
On 11/10/2013 12:35 PM, Kenji Hara wrote: 2013/11/10 Timon Gehr mailto:timon.g...@gmx.ch>> ... = Do you think that in this case one should implement identical mutable and immutable postblit? I think yes. This still leaves the issue outlined in the other post though. How to co

Re: DIP49 - Define qualified postblit

2013-11-10 Thread Timon Gehr
On 11/10/2013 12:07 PM, Kenji Hara wrote: Condider a case that copying "inout struct" inside inout function. struct S { int[] arr; this(this) ??? { } } int[] foo(inout S src) { S dst = src; // copy inout S to S return dst.arr; } If the struct S has postblit, what shold be do

Re: DIP49 - Define qualified postblit

2013-11-10 Thread Kenji Hara
2013/11/10 Timon Gehr > On 11/10/2013 07:46 AM, Kenji Hara wrote: > >> http://wiki.dlang.org/DIP49 >> >> Experimental compiler/druntime patches (WIP, 80% completed): >> https://github.com/9rnsr/dmd/tree/qual_pblit >> https://github.com/9rnsr/druntime/tree/qual_pblit >> >> Kenji Hara >> > > Well w

Re: DIP49 - Define qualified postblit

2013-11-10 Thread Kenji Hara
2013/11/10 deadalnix > I like it up to the unique part. For mutable/const/immutable postblit, I > do think this is it, you nailed it perfectly. > Thans for the comment, @deadlnix. For the unique part, this become tricky, as we do not specify what is a > unique expression. For this, I do not thi

Re: DIP49 - Define qualified postblit

2013-11-10 Thread Timon Gehr
On 11/10/2013 07:46 AM, Kenji Hara wrote: http://wiki.dlang.org/DIP49 Experimental compiler/druntime patches (WIP, 80% completed): https://github.com/9rnsr/dmd/tree/qual_pblit https://github.com/9rnsr/druntime/tree/qual_pblit Kenji Hara Well written DIP! - Rules [c1] and [c5] are unsound and

Re: DIP49 - Define qualified postblit

2013-11-10 Thread deadalnix
On Sunday, 10 November 2013 at 06:46:47 UTC, Kenji Hara wrote: http://wiki.dlang.org/DIP49 Experimental compiler/druntime patches (WIP, 80% completed): https://github.com/9rnsr/dmd/tree/qual_pblit https://github.com/9rnsr/druntime/tree/qual_pblit Kenji Hara I like it up to the unique part. Fo

DIP49 - Define qualified postblit

2013-11-09 Thread Kenji Hara
http://wiki.dlang.org/DIP49 Experimental compiler/druntime patches (WIP, 80% completed): https://github.com/9rnsr/dmd/tree/qual_pblit https://github.com/9rnsr/druntime/tree/qual_pblit Kenji Hara