Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Manu via Digitalmars-d
On Fri, 20 Jul 2018 at 22:45, Nicholas Wilson via Digitalmars-d wrote: > > On Saturday, 21 July 2018 at 04:09:25 UTC, Jonathan M Davis wrote: > > Honestly, I think we're just coming from points of view that > > are too different. IMHO, the core use case for ref is for a > > function to mutate an a

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Nicholas Wilson via Digitalmars-d
On Saturday, 21 July 2018 at 04:09:25 UTC, Jonathan M Davis wrote: Honestly, I think we're just coming from points of view that are too different. IMHO, the core use case for ref is for a function to mutate an argument and have that result progagate to the argument, I think the critical point

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 20, 2018 19:13:00 Manu via Digitalmars-d wrote: > I can't see how this is a compelling reason to dismiss all the > advantages of this DIP in favour of keeping the current semantic. Honestly, I think we're just coming from points of view that are too different. IMHO, the core use ca

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Manu via Digitalmars-d
On Fri, 20 Jul 2018 at 18:17, Jonathan M Davis via Digitalmars-d wrote: > > On Friday, July 20, 2018 18:04:26 Manu via Digitalmars-d wrote: > > On Fri, 20 Jul 2018 at 18:02, Manu wrote: > > > [...] > > > > > > I think you're describing now a bug where a function returns an > > > lvalue, but it wa

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 20, 2018 18:04:26 Manu via Digitalmars-d wrote: > On Fri, 20 Jul 2018 at 18:02, Manu wrote: > > [...] > > > > I think you're describing now a bug where a function returns an > > lvalue, but it was meant to return an rvalue. > > Sorry, wrong way around! I meant to say: > I think you

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Manu via Digitalmars-d
On Fri, 20 Jul 2018 at 18:02, Manu wrote: > > [...] > > I think you're describing now a bug where a function returns an > lvalue, but it was meant to return an rvalue. Sorry, wrong way around! I meant to say: I think you're describing now a bug where a function returns an rvalue, but it was meant

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Manu via Digitalmars-d
On Fri, 20 Jul 2018 at 17:33, Jonathan M Davis via Digitalmars-d wrote: > > On Saturday, July 21, 2018 00:10:09 Nicholas Wilson via Digitalmars-d wrote: > > So this problem is restricted output range @properties that > > somehow don't return by ref, aren't intended to be used after > > having data

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Jonathan M Davis via Digitalmars-d
On Saturday, July 21, 2018 00:10:09 Nicholas Wilson via Digitalmars-d wrote: > So this problem is restricted output range @properties that > somehow don't return by ref, aren't intended to be used after > having data written to them _and_ aren't singleton like? It's a problem for any function that

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Nicholas Wilson via Digitalmars-d
On Friday, 20 July 2018 at 23:35:46 UTC, Jonathan M Davis wrote: On Friday, July 20, 2018 14:35:57 Manu via Digitalmars-d wrote: Comparatively rare? It's exactly what most functions using output ranges need to do. For many output ranges, if the function copies the range instead of copying, then

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 20, 2018 14:35:57 Manu via Digitalmars-d wrote: > > > Their currently behaviour is mostly wrong, and the exact thing I'm > > > trying to fix though. > > > > Why would the current behviour be mostly wrong? If the purpose of using > > ref is to accept the current value of a variable a

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Nicholas Wilson via Digitalmars-d
On Friday, 20 July 2018 at 16:39:46 UTC, Dukc wrote: On Friday, 20 July 2018 at 09:39:47 UTC, Nicholas Wilson wrote: appending something (like .byRef or byRef!long, the latter making an implicit type conversion) That can't work: either it returns an expired stack temporary (*very* bad), or al

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Manu via Digitalmars-d
On Fri, 20 Jul 2018 at 12:51, Jonathan M Davis via Digitalmars-d wrote: > > On Friday, July 20, 2018 12:21:42 Manu via Digitalmars-d wrote: > > I think disabling it is going to be the overwhelmingly niche case, but > > it's good that you can still do it and be satisfied if that's what you > > want

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Elie Morisse via Digitalmars-d
On Friday, 20 July 2018 at 05:16:53 UTC, Mike Parker wrote: This is the feedback thread for the first round of Community Review for DIP 1016, "ref T accepts r-values": https://github.com/dlang/DIPs/blob/725541d69149bc85a9492f7df07360f8e2948bd7/DIPs/DIP1016.md Yay! Thank you Manu for taking th

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Manu via Digitalmars-d
On Fri, 20 Jul 2018 at 12:36, Jonathan M Davis via Digitalmars-d wrote: > > On Friday, July 20, 2018 11:50:41 Manu via Digitalmars-d wrote: > > > I am completely against allowing ref to accept rvalues without some sort > > > of attribute indicating that it should be allowed to (e.g. @rvalue > > >

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 20, 2018 12:21:42 Manu via Digitalmars-d wrote: > I think disabling it is going to be the overwhelmingly niche case, but > it's good that you can still do it and be satisfied if that's what you > want to do. > > Can you link me to a single line of your own code where you've used > t

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 20, 2018 11:50:41 Manu via Digitalmars-d wrote: > > I am completely against allowing ref to accept rvalues without some sort > > of attribute indicating that it should be allowed to (e.g. @rvalue > > ref). > I sincerely hope you're in the minority :( > > > Allowing ref to accept rva

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Manu via Digitalmars-d
On Fri, 20 Jul 2018 at 11:05, Jonathan M Davis via Digitalmars-d wrote: > > On Friday, July 20, 2018 17:25:25 Daniel N via Digitalmars-d wrote: > > On Friday, 20 July 2018 at 17:02:04 UTC, Jonathan M Davis wrote: > > > On Friday, July 20, 2018 16:42:54 aliak via Digitalmars-d wrote: > > >> On Frid

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Manu via Digitalmars-d
On Fri, 20 Jul 2018 at 06:21, Jonathan M Davis via Digitalmars-d wrote: > > On Friday, July 20, 2018 05:16:53 Mike Parker via Digitalmars-d wrote: > > This is the feedback thread for the first round of Community > > Review for DIP 1016, "ref T accepts r-values": > > > > https://github.com/dlang/DI

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Manu via Digitalmars-d
On Fri, 20 Jul 2018 at 05:40, Steven Schveighoffer via Digitalmars-d wrote: > > On 7/20/18 1:16 AM, Mike Parker wrote: > > This is the feedback thread for the first round of Community Review for > > DIP 1016, "ref T accepts r-values": > > > > https://github.com/dlang/DIPs/blob/725541d69149bc85a949

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 20, 2018 17:25:25 Daniel N via Digitalmars-d wrote: > On Friday, 20 July 2018 at 17:02:04 UTC, Jonathan M Davis wrote: > > On Friday, July 20, 2018 16:42:54 aliak via Digitalmars-d wrote: > >> On Friday, 20 July 2018 at 13:21:11 UTC, Jonathan M Davis > >> > >> But as for a UDA, mayb

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Manu via Digitalmars-d
On Fri, 20 Jul 2018 at 04:50, Seb via Digitalmars-d wrote: > > On Friday, 20 July 2018 at 05:16:53 UTC, Mike Parker wrote: > > This is the feedback thread for the first round of Community > > Review for DIP 1016, "ref T accepts r-values": > > > > https://github.com/dlang/DIPs/blob/725541d69149bc85

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Manu via Digitalmars-d
On Fri, 20 Jul 2018 at 03:55, Petar via Digitalmars-d wrote: > > On Friday, 20 July 2018 at 05:16:53 UTC, Mike Parker wrote: > > This is the feedback thread for the first round of Community > > Review for DIP 1016, "ref T accepts r-values": > > > > https://github.com/dlang/DIPs/blob/725541d69149bc

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Manu via Digitalmars-d
On Fri, 20 Jul 2018 at 02:05, Dukc via Digitalmars-d wrote: > > On Friday, 20 July 2018 at 05:16:53 UTC, Mike Parker wrote: > > This is the feedback thread for the first round of Community > > Review for DIP 1016, "ref T accepts r-values" > > I'd prefer a solution which allows one to make an invis

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Manu via Digitalmars-d
On Fri, 20 Jul 2018 at 03:10, Dgame via Digitalmars-d wrote: > > On Friday, 20 July 2018 at 09:39:47 UTC, Nicholas Wilson wrote: > > On Friday, 20 July 2018 at 09:03:18 UTC, Dukc wrote: > >> appending something (like .byRef or byRef!long, the latter > >> making an implicit type conversion) > > > >

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Daniel N via Digitalmars-d
On Friday, 20 July 2018 at 17:02:04 UTC, Jonathan M Davis wrote: On Friday, July 20, 2018 16:42:54 aliak via Digitalmars-d wrote: On Friday, 20 July 2018 at 13:21:11 UTC, Jonathan M Davis But as for a UDA, maybe @implicit from the copy constructor DIP can be reused here? void f(@implicit ref

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Manu via Digitalmars-d
On Fri, 20 Jul 2018 at 02:25, Bastiaan Veelo via Digitalmars-d wrote: > > On Friday, 20 July 2018 at 05:16:53 UTC, Mike Parker wrote: > > This is the feedback thread for the first round of Community > > Review for DIP 1016, "ref T accepts r-values": > > > > https://github.com/dlang/DIPs/blob/72554

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 20, 2018 16:42:54 aliak via Digitalmars-d wrote: > On Friday, 20 July 2018 at 13:21:11 UTC, Jonathan M Davis wrote: > > On Friday, July 20, 2018 05:16:53 Mike Parker via Digitalmars-d > > > > wrote: > >> [...] > > > > I am completely against allowing ref to accept rvalues without >

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread aliak via Digitalmars-d
On Friday, 20 July 2018 at 13:21:11 UTC, Jonathan M Davis wrote: On Friday, July 20, 2018 05:16:53 Mike Parker via Digitalmars-d wrote: [...] I am completely against allowing ref to accept rvalues without some sort of attribute indicating that it should be allowed to (e.g. @rvalue ref). Allo

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Dukc via Digitalmars-d
On Friday, 20 July 2018 at 09:39:47 UTC, Nicholas Wilson wrote: appending something (like .byRef or byRef!long, the latter making an implicit type conversion) That can't work: either it returns an expired stack temporary (*very* bad), or allocates with no way to deallocate (bad). How so? It

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Dukc via Digitalmars-d
On Friday, 20 July 2018 at 09:24:19 UTC, Bastiaan Veelo wrote: On Friday, 20 July 2018 at 09:03:18 UTC, Dukc wrote: Thanks for the effort to make it... I believe Manu will be pleased. Manu is the one who wrote the DIP :-) Though it was Mike :-)

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 20, 2018 15:50:29 meppl via Digitalmars-d wrote: > On Friday, 20 July 2018 at 13:21:11 UTC, Jonathan M Davis wrote: > > On Friday, July 20, 2018 05:16:53 Mike Parker via Digitalmars-d > > > > wrote: > >> ... > > > > ... > > Allowing ref to accept rvalues goes completely against the

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread meppl via Digitalmars-d
On Friday, 20 July 2018 at 13:21:11 UTC, Jonathan M Davis wrote: On Friday, July 20, 2018 05:16:53 Mike Parker via Digitalmars-d wrote: ... ... Allowing ref to accept rvalues goes completely against the idea that ref is for passing an object so that it can be mutated and have its result affe

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 20, 2018 15:18:33 Daniel N via Digitalmars-d wrote: > On Friday, 20 July 2018 at 13:21:11 UTC, Jonathan M Davis wrote: > > auto ref was already introduced to solve this problem. The > > problem of course is that it requires that the function be > > templated, and while that's often

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Radu via Digitalmars-d
On Friday, 20 July 2018 at 05:16:53 UTC, Mike Parker wrote: This is the feedback thread for the first round of Community Review for DIP 1016, "ref T accepts r-values": https://github.com/dlang/DIPs/blob/725541d69149bc85a9492f7df07360f8e2948bd7/DIPs/DIP1016.md All review-related feedback on and

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Daniel N via Digitalmars-d
On Friday, 20 July 2018 at 13:21:11 UTC, Jonathan M Davis wrote: auto ref was already introduced to solve this problem. The problem of course is that it requires that the function be templated, and while that's often desirable, it's not always a viable option (e.g. it doesn't work with virtua

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 20, 2018 05:16:53 Mike Parker via Digitalmars-d wrote: > This is the feedback thread for the first round of Community > Review for DIP 1016, "ref T accepts r-values": > > https://github.com/dlang/DIPs/blob/725541d69149bc85a9492f7df07360f8e2948bd > 7/DIPs/DIP1016.md > > All review-re

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Steven Schveighoffer via Digitalmars-d
On 7/20/18 1:16 AM, Mike Parker wrote: This is the feedback thread for the first round of Community Review for DIP 1016, "ref T accepts r-values": https://github.com/dlang/DIPs/blob/725541d69149bc85a9492f7df07360f8e2948bd7/DIPs/DIP1016.md All review-related feedback on and discussion of the

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Timoses via Digitalmars-d
On Friday, 20 July 2018 at 05:16:53 UTC, Mike Parker wrote: Thanks in advance to all who participate. "It has been noted that is it possible" switch: it <-> is

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Seb via Digitalmars-d
On Friday, 20 July 2018 at 05:16:53 UTC, Mike Parker wrote: This is the feedback thread for the first round of Community Review for DIP 1016, "ref T accepts r-values": https://github.com/dlang/DIPs/blob/725541d69149bc85a9492f7df07360f8e2948bd7/DIPs/DIP1016.md All review-related feedback on and

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Seb via Digitalmars-d
On Friday, 20 July 2018 at 10:43:54 UTC, Dgame wrote: On Friday, 20 July 2018 at 10:31:48 UTC, Seb wrote: On Friday, 20 July 2018 at 10:08:03 UTC, Dgame wrote: On Friday, 20 July 2018 at 09:39:47 UTC, Nicholas Wilson wrote: On Friday, 20 July 2018 at 09:03:18 UTC, Dukc wrote: appending somethi

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Petar via Digitalmars-d
On Friday, 20 July 2018 at 05:16:53 UTC, Mike Parker wrote: This is the feedback thread for the first round of Community Review for DIP 1016, "ref T accepts r-values": https://github.com/dlang/DIPs/blob/725541d69149bc85a9492f7df07360f8e2948bd7/DIPs/DIP1016.md All review-related feedback on and

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Dgame via Digitalmars-d
On Friday, 20 July 2018 at 10:31:48 UTC, Seb wrote: On Friday, 20 July 2018 at 10:08:03 UTC, Dgame wrote: On Friday, 20 July 2018 at 09:39:47 UTC, Nicholas Wilson wrote: On Friday, 20 July 2018 at 09:03:18 UTC, Dukc wrote: appending something (like .byRef or byRef!long, the latter making an im

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Petar via Digitalmars-d
On Friday, 20 July 2018 at 10:08:03 UTC, Dgame wrote: On Friday, 20 July 2018 at 09:39:47 UTC, Nicholas Wilson wrote: On Friday, 20 July 2018 at 09:03:18 UTC, Dukc wrote: appending something (like .byRef or byRef!long, the latter making an implicit type conversion) That can't work: either it

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Seb via Digitalmars-d
On Friday, 20 July 2018 at 10:08:03 UTC, Dgame wrote: On Friday, 20 July 2018 at 09:39:47 UTC, Nicholas Wilson wrote: On Friday, 20 July 2018 at 09:03:18 UTC, Dukc wrote: appending something (like .byRef or byRef!long, the latter making an implicit type conversion) That can't work: either it

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Dgame via Digitalmars-d
On Friday, 20 July 2018 at 09:39:47 UTC, Nicholas Wilson wrote: On Friday, 20 July 2018 at 09:03:18 UTC, Dukc wrote: appending something (like .byRef or byRef!long, the latter making an implicit type conversion) That can't work: either it returns an expired stack temporary (*very* bad), or al

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Nicholas Wilson via Digitalmars-d
On Friday, 20 July 2018 at 08:12:00 UTC, Dominikus Dittes Scherkl wrote: On Friday, 20 July 2018 at 05:16:53 UTC, Mike Parker wrote: This is the feedback thread for the first round of Community Review for DIP 1016, "ref T accepts r-values": https://github.com/dlang/DIPs/blob/725541d69149bc85a9

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Nicholas Wilson via Digitalmars-d
On Friday, 20 July 2018 at 09:03:18 UTC, Dukc wrote: appending something (like .byRef or byRef!long, the latter making an implicit type conversion) That can't work: either it returns an expired stack temporary (*very* bad), or allocates with no way to deallocate (bad).

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Bastiaan Veelo via Digitalmars-d
On Friday, 20 July 2018 at 09:03:18 UTC, Dukc wrote: Thanks for the effort to make it... I believe Manu will be pleased. Manu is the one who wrote the DIP :-)

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Bastiaan Veelo via Digitalmars-d
On Friday, 20 July 2018 at 05:16:53 UTC, Mike Parker wrote: This is the feedback thread for the first round of Community Review for DIP 1016, "ref T accepts r-values": https://github.com/dlang/DIPs/blob/725541d69149bc85a9492f7df07360f8e2948bd7/DIPs/DIP1016.md The only difficulty I had was rea

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Dukc via Digitalmars-d
On Friday, 20 July 2018 at 05:16:53 UTC, Mike Parker wrote: This is the feedback thread for the first round of Community Review for DIP 1016, "ref T accepts r-values" I'd prefer a solution which allows one to make an invisible temp manually without making a new statement or a new symbol name.

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-20 Thread Dominikus Dittes Scherkl via Digitalmars-d
On Friday, 20 July 2018 at 05:16:53 UTC, Mike Parker wrote: This is the feedback thread for the first round of Community Review for DIP 1016, "ref T accepts r-values": https://github.com/dlang/DIPs/blob/725541d69149bc85a9492f7df07360f8e2948bd7/DIPs/DIP1016.md +1 The DIP reduces bloat, doesn'

Re: multiple alias this

2018-07-20 Thread Mike Franklin via Digitalmars-d
On Friday, 20 July 2018 at 00:26:43 UTC, Mr.Bingo wrote: [...] I didn't read through all of that, but just so you are aware, a *multiple alias this* DIP was already approved. You can find it at https://wiki.dlang.org/DIP66 The implementation is already started and you can find it at https