Proposal for design of 'scope' (Was: Re: Opportunities for D)
Jacob Carlborg via Digitalmars-d
digitalmars-d at puremagic.com
Mon Jul 14 23:42:20 PDT 2014
On 14/07/14 18:16, H. S. Teoh via Digitalmars-d wrote:
> Mine is here:
>
> http://wiki.dlang.org/User:Quickfur/DIP_scope
From the DIP:
"The 'scope' keyword has been around for years, yet it is barely
implemented and it's unclear just what it's supposed to mean"
I don't know if it's worth clarify but "scope" currently has various
features.
1. Allocate classes on the stack: "scope bar = new Bar()"
2. Forcing classes to be allocated on the stack: "scope class Bar {}"
3. The scope-statement: "scope(exit) file.close()"
4. Scope parameters. This is the part that is unclear what is means/is
supposed to mean in the current language
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list