DIP69 - Implement scope for escape proof references

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 11 23:47:27 PST 2014


On 12/11/2014 10:06 PM, Dicebot wrote:
> On Thursday, 11 December 2014 at 21:41:11 UTC, Walter Bright wrote:
>> Consider a ref counted type, RC!T. If scope were transitive, then you could
>> not have, say, a tree where the edges were RC!T. I.e., the payload of an RC
>> type should not be forced to be scope.
>
> I don't see how this is related. It would be perfectly ok to declare root of
> such tree scope if it was transitive (as long as it only controls access and
> does not attempt early destruction).

Are you suggesting two kinds of scope - transitive and non-transitive?

The more I think about it, the more ref counting is the definitive case, as just 
about everything else can be explained in terms of how ref counting works.



More information about the Digitalmars-d mailing list