The next iteration of scope

Nick Treleaven via Digitalmars-d digitalmars-d at puremagic.com
Sun Mar 15 10:31:15 PDT 2015


On 15/03/2015 14:10, "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm at gmx.net>" 
wrote:
> Here's the new version of my scope proposal:
> http://wiki.dlang.org/User:Schuetzm/scope2
>
> It's still missing real-life examples, a section on the implementation,
> and a more formal specification, as well as a discussion of backwards
> compatibility. But I thought I'd show what I have, so that it can be
> discussed early on.
>
> I hope it will be more digestible for Walter & Andrei. It's more or less
> an extended version of DIP25, and avoids the need for most explicit
> annotations.

I too want a scope attribute e.g. for safe slicing of static arrays, 
etc. I'm not sure if it's too late for scope by default though, perhaps.

I like postblit overloading on whether 'this' can be scope or not, 
allowing efficient ref-counting.

     scope T payload;

^ This is a nice way to help enforce the correctness of @safe wrapper types.


More information about the Digitalmars-d mailing list