DIP69 - Implement scope for escape proof references

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 4 06:58:47 PST 2014


On 12/4/14 4:24 AM, Walter Bright wrote:
> http://wiki.dlang.org/DIP69
>
> Despite its length, this is a fairly simple proposal. It adds the
> missing semantics for the 'scope' storage class in order to make it
> possible to pass a reference to a function without it being possible for
> it to escape.
>
> This, among other things, makes a ref counting type practical. It also
> makes it more practical to use other storage allocation schemes than
> garbage collection.
>
> It does not make scope into a type constructor, nor a general
> type-annotation system.
>
> It does not provide an ownership system, though it would complement one.

"There can be at most one owner for any piece of data."

This doesn't seem right. For GC data, the GC owns the data, that is 
true. But for Ref-counted data, there is more than one owner, and only 
when all the owners disown the data can it be destroyed.

I think there is a disconnect here, you can't say *nobody* owns the 
data, and if you say one variable owns the data, which one is it?

Continuing to read...

-Steve


More information about the Digitalmars-d mailing list