DIP 1005 - Preliminary Review Round 1
Timon Gehr via Digitalmars-d
digitalmars-d at puremagic.com
Sat Apr 22 09:21:22 PDT 2017
On 22.04.2017 18:17, Timon Gehr wrote:
> On 22.04.2017 17:16, Andrej Mitrovic wrote:
>> On Saturday, 22 April 2017 at 11:54:08 UTC, Mike Parker wrote:
>>> https://github.com/dlang/DIPs/blob/master/DIPs/DIP1005.md
>>
>>> with (Type) and with (TemplateInstance) are always declarations and do
>>> not introduce a new scope.
>>
>> Does that mean we can now do things like this?:
>>
>> -----
>> module m;
>> struct A { struct B { } }
>> with (A) B b;
>> -----
>>
>> That's a pretty cool addition.
>
> With the current wording of the DIP, this will not work in local scopes.
> Why do we need more features for declaring global variables?
Correction: It will not work in function scopes.
More information about the Digitalmars-d
mailing list