Why is `scope` planned for deprecation?

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 11 07:29:40 PST 2014


This is a bit complicated. Originally intention was to deprecate 
scope variables (scope var = new Class) completely and make 
people switch to std.typecons.scoped - primarily because of how 
fragile and inflexible its implementation was (can't have scope 
fields in aggregates for example)

However it never actually got deprecated and still kind of works 
with no warnings printed by compiler. Also I remember Daniel 
mentioning that he uses it extensively in DDMD project which, 
unfortunately, makes full deprecation unlikely.

There is however a long standing desire to re-purpose `scope` as 
qualifier for lifetime/ownership semantics which could have made 
current uses simply a subset of full `scope` implementation. But 
this is very complicated topic and may take years to fly.


More information about the Digitalmars-d mailing list