Jump to page: 1 2 3
Thread overview
DIP 1005 - Preliminary Review Round 1
Apr 22, 2017
Mike Parker
Apr 22, 2017
9il
Apr 22, 2017
Andrej Mitrovic
Apr 22, 2017
Timon Gehr
Apr 22, 2017
Timon Gehr
Apr 22, 2017
Andrej Mitrovic
Apr 22, 2017
Timon Gehr
Apr 22, 2017
Andrej Mitrovic
Apr 22, 2017
Timon Gehr
Apr 22, 2017
Stefan Koch
Apr 22, 2017
Timon Gehr
Apr 22, 2017
Joakim
Apr 23, 2017
Andrej Mitrovic
Apr 23, 2017
deadalnix
Apr 23, 2017
Andrej Mitrovic
Apr 23, 2017
deadalnix
Apr 23, 2017
Jacob Carlborg
Apr 23, 2017
Arturg
Apr 24, 2017
Jon Degenhardt
Apr 23, 2017
deadalnix
May 06, 2017
Mike Parker
May 06, 2017
Mike Parker
May 12, 2017
Jonathan M Davis
May 12, 2017
Joakim
May 14, 2017
Mike Parker
April 22, 2017
DIP 1005 is titled "Dependency-Carrying Declarations".

https://github.com/dlang/DIPs/blob/master/DIPs/DIP1005.md

All review-related feedback on and discussion of the DIP should occur in this thread. Due to DConf taking place during the review period, the period will be extended by a week. The review period will end at 11:59 PM ET on May 13 (3:59 AM GMT on May 14), or when I make a post declaring it complete.

At the end of Round 1, if further review is deemed necessary, the DIP will be scheduled for another round. Otherwise, because the DIP comes from a language author and no formal review period by the language authors is necessary, the DIP will be marked "Accepted" or "Rejected" at the author's discretion.

An extensive discussion regarding this DIP has already taken place [1].

Thanks in advance to all who participate.

Destroy!

[1] http://forum.dlang.org/thread/o2psvk$1m96$1@digitalmars.com?page=1
April 22, 2017
On Saturday, 22 April 2017 at 11:54:08 UTC, Mike Parker wrote:
> DIP 1005 is titled "Dependency-Carrying Declarations".
>
> https://github.com/dlang/DIPs/blob/master/DIPs/DIP1005.md

Oh, this is huge, great work! Many thanks to all authors! --Ilya
April 22, 2017
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.
April 22, 2017
On Saturday, 22 April 2017 at 11:54:08 UTC, Mike Parker wrote:
> https://github.com/dlang/DIPs/blob/master/DIPs/DIP1005.md

Very solid DIP! And I like the use of `with` and it's proposed extension to be allowed in declarations, rather than introducing new syntax.
April 22, 2017
On 22.04.2017 13:54, Mike Parker wrote:
> DIP 1005 is titled "Dependency-Carrying Declarations".
>
> https://github.com/dlang/DIPs/blob/master/DIPs/DIP1005.md
>
> All review-related feedback on and discussion of the DIP should occur in
> this thread. Due to DConf taking place during the review period, the
> period will be extended by a week. The review period will end at 11:59
> PM ET on May 13 (3:59 AM GMT on May 14), or when I make a post declaring
> it complete.
>
> At the end of Round 1, if further review is deemed necessary, the DIP
> will be scheduled for another round. Otherwise, because the DIP comes
> from a language author and no formal review period by the language
> authors is necessary, the DIP will be marked "Accepted" or "Rejected" at
> the author's discretion.
>
> An extensive discussion regarding this DIP has already taken place [1].
>
> Thanks in advance to all who participate.
>
> Destroy!
>
> [1] http://forum.dlang.org/thread/o2psvk$1m96$1@digitalmars.com?page=1


"* Inside any function, all uses of with are statements and obey the current language rules.

* Everywhere else, ..."


"* Inside any function, with (Import ImportList) is a statement that introduces a scope. Inside the with, lookup considers the import local to the declaration (similar to the current handling of nested imports).

* Everywhere else, ..."


Please don't do this.



"This extension removes an unforced limitation of the current with syntax (allows it to occur at top level)"

No, it does not. It introduces two more incompatible syntaxes that look the same, yet are different.



"The drawback of this choice is the potentially confusing handling of scopes: the with statement introduces a scope, whereas the with declaration does not."

It's not merely confusing, it's frustrating. I might legitimately want to use the new feature on a local declaration. As an analogy, just imagine how frustrating it would be if 'static if' was written as 'if' with different meaning depending on the scope.



Just associate actual syntax to the the scope handling. The proposal would be sane if it instead introduced a new 'static with' construct that actually has the same meaning in every context.

This is how it works for static if, and it is also how it will work for static foreach, so it is even consistent with other language features.

April 22, 2017
On 22.04.2017 17:31, 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
>
> Very solid DIP! And I like the use of `with` and it's proposed extension
> to be allowed in declarations, rather than introducing new syntax.

Please reconsider. This is new syntax. It looks like old syntax but behaves differently.
April 22, 2017
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?
April 22, 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.
April 22, 2017
On Saturday, 22 April 2017 at 16:13:20 UTC, Timon Gehr wrote:
> This is how it works for static if, and it is also how it will work for static foreach, so it is even consistent with other language features.

So you will touch up your static foreach DIP ?
If so I am okay with building the implementation.
April 22, 2017
On 22.04.2017 18:25, Stefan Koch wrote:
> On Saturday, 22 April 2017 at 16:13:20 UTC, Timon Gehr wrote:
>> This is how it works for static if, and it is also how it will work
>> for static foreach, so it is even consistent with other language
>> features.
>
> So you will touch up your static foreach DIP ?
> If so I am okay with building the implementation.

Sounds good. Let's discuss this at DConf.
« First   ‹ Prev
1 2 3