DIP69 - Implement scope for escape proof references

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 10 14:05:09 PST 2014


On Wednesday, 10 December 2014 at 15:15:59 UTC, Ola Fosheim
Grøstad wrote:
> On Tuesday, 9 December 2014 at 21:58:48 UTC, deadalnix wrote:
>> That why i say they are linked. I don't think your way of 
>> stating
>> it contradict what I said.
>>
>> scope allow for manipulation of data without owning them.
>> Whatever the owner is (be it the stack frame or anything else)
>> doesn't really matter here.
>
> It does when you return parts of it, like if you pass in a 
> binary tree and return a node. Which you have to be able to do 
> for the concept to make sense.
>
> When you solve issues in language design you should address the 
> hard issues first, because the easy issues will then tend to 
> resolve themselves if the design is good. If you start with 
> "the low hanging fruit" you end up with pointless special 
> casing… D is already in that landscape and should try hard not 
> to sink deeper into the muddy waters.
>
> I posit that if you have a solution for ownership/retaining 
> references then the solution for scope will come from this as a 
> side-effect.

That is completely off topic. this is a function parameter, you
can return scope, and you don't need to know who own the
container for that to work.

Granted, the current proposal lack the horsepower to do so.


More information about the Digitalmars-d mailing list