Re: Coming back, Unique, opDot and whatever else

2014-01-19 Thread Jacob Carlborg
On 2014-01-17 21:25, Stanislav Blinov wrote: Ahem. Wasn't it what I said? :) I don't know, perhaps I missed that :) Of course I did try. My concern is that it would stop accepting arbitrary user types. Most times this would be a good thing. But not always. Hence I'm hesitating :) Right,

Re: Coming back, Unique, opDot and whatever else

2014-01-19 Thread Stanislav Blinov
On Friday, 17 January 2014 at 20:25:37 UTC, Stanislav Blinov wrote: Heh, now I'm even more leaning towards a proxy. Because honestly, x.opDispatch!(release)() is even uglier than x.opDot().release() :D... Well, what can I say? I didn't need to go very far. Because Phobos has such proxy.

Re: Coming back, Unique, opDot and whatever else

2014-01-19 Thread Jacob Carlborg
On 2014-01-18 13:07, Stanislav Blinov wrote: That's the approach I took. I've moved both _Transfer and _Clear into module scope and renamed them. And indeed, the compiler prefers opDispatch(). But not if I call them like .clearUnique(this) :) Right, I was mostly thinking of public methods,

Re: Coming back, Unique, opDot and whatever else

2014-01-19 Thread Rory McGuire
opDispatch works do you can just type object.release

Re: Coming back, Unique, opDot and whatever else

2014-01-19 Thread Stanislav Blinov
On Sunday, 19 January 2014 at 22:25:08 UTC, Rory McGuire wrote: opDispatch works do you can just type object.release This will call Unique's release(). To get to wrapped object's release(), you need object.opDispatch(release)().

Re: Coming back, Unique, opDot and whatever else

2014-01-17 Thread Stanislav Blinov
On Friday, 17 January 2014 at 06:25:53 UTC, qznc wrote: Improving Phobos code by filling in the blanks is usually a good idea and a good learning experience as well. Oh, I wasn't proposing to stick that into Phobos, not in its current state. I'm not that arrogant :) Even given that I resolve

Re: Coming back, Unique, opDot and whatever else

2014-01-17 Thread Stanislav Blinov
On Friday, 17 January 2014 at 07:34:58 UTC, Jacob Carlborg wrote: opDot has been replaced with opDispatch [1] and alias this [2]. I know, it was just a shortcut for now. Although alias this is of little help in case of Unique, at least without additional middle man. After all, the whole

Re: Coming back, Unique, opDot and whatever else

2014-01-17 Thread Jacob Carlborg
On 2014-01-17 16:18, Stanislav Blinov wrote: As far as I understand it, it can. I mean, I don't see where I would violate any of the rules attached to @safe. The only danger zone is dereference, and that's protected by throwing. But I commented it out because I started having doubts: in my

Re: Coming back, Unique, opDot and whatever else

2014-01-17 Thread Stanislav Blinov
On Friday, 17 January 2014 at 20:06:08 UTC, Jacob Carlborg wrote: Unique would fail to compile with those (failed semantic analysis). So it would seem it's rather restrictive. I don't mind imposing correctness, but how far should it go? Just try and @safe and see what happens. These really

Re: Coming back, Unique, opDot and whatever else

2014-01-16 Thread Stanislav Blinov
Oh woops, it seems I misclicked the links and ended up posing in .announce instead of .learn. Sorry about that! If this is in any way movable, I'd be obliged. Thanks!

Re: Coming back, Unique, opDot and whatever else

2014-01-16 Thread qznc
On Friday, 17 January 2014 at 01:12:04 UTC, Stanislav Blinov wrote: Hello everyone! It's been a long time since I last posted here, I've been away from all things D, only being able to take an occasional peek from time to time. It's so good to be back. I'm now finding a bit of time to commit

Re: Coming back, Unique, opDot and whatever else

2014-01-16 Thread Jacob Carlborg
On 2014-01-17 02:12, Stanislav Blinov wrote: Hello everyone! It's been a long time since I last posted here, I've been away from all things D, only being able to take an occasional peek from time to time. It's so good to be back. I'm now finding a bit of time to commit to learn D, more relearn