DIP69 - Implement scope for escape proof references

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 4 12:52:59 PST 2014


On 12/4/2014 7:04 AM, Steven Schveighoffer wrote:
> "Scope affects:
>
>      local variables allocated on the stack"
>
> ...
>
> "scope int i;       // scope is ignored because integers are not references and
> so are not views"
>
> I think I understand what you are trying to say -- the (big S) Scope of a local
> variable cannot escape, but it serves no purpose to declare a local int as
> (keyword) scope, since it's not going to be assigned any references.
>
> But it reads contradictory.

If you think that is contradictory, you should have read the earlier drafts :-)

Basically, I had to get straight in my head the difference between the scope of 
the variable and the scope of its payload.

The keyword 'scope' only affects the payload.



More information about the Digitalmars-d mailing list