DIP69 - Implement scope for escape proof references

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 19 21:44:17 PST 2014


On Tuesday, 16 December 2014 at 01:00:47 UTC, Walter Bright wrote:
> On 12/15/2014 5:38 AM, deadalnix wrote:
>> On Monday, 15 December 2014 at 11:32:11 UTC, Dicebot wrote:
>>> For me "scopeness" is a property of "view", not object itself 
>>> - this also
>>> makes ownership method of actual data irrelevant. Only 
>>> difference between GC
>>> owned data and stack allocated one is that former can have 
>>> scoped view
>>> optionally but for the latter compiler must force it as the 
>>> only available.
>>
>> Ha finally something start to make sense here.
>
> Well, the DIP does defined scope in terms of a 'view' in just 
> this manner.
>
> I am obviously terrible at explaining things.

Such notion of "view" requires at least some elements of 
transitivity to be practical in my opinion. Also with my 
definition in mind your example of tree that stores scope nodes 
makes absolutely no sense unless whole tree itself is scoped (and 
nodes are thus scoped transitively). Such view is always assumes 
worst case about ownership and shouldn't persist in any form (as 
that would require some serious ownership tracking).

I don't think you have explained your case that bad - we simply 
have a very different use cases in mind as "primary" use case.


More information about the Digitalmars-d mailing list