fix Issue 13855 - multi-module selective import statements#6589
fix Issue 13855 - multi-module selective import statements#6589andralex merged 1 commit intodlang:masterfrom
Conversation
|
Thanks for your pull request, @MartinNowak! Bugzilla references
|
|
This will be somewhat of a bike-shedding issue, so please refrain from lengthy discussions and use the |
|
Voted. Isn't that DIP material though ? |
|
As mentioned on bugzilla, I find the result to be less legible, not more. |
|
Added a small argument, imports provide little information and ought to be concise IMHO. https://issues.dlang.org/show_bug.cgi?id=13855#c5 |
|
If we cannot agree on this anyhow, would there be interest in a DIP for a bigger syntax change?
Again I'm finding myself spending lots of time typing and shoveling around noisy imports, so would like have a more concise syntax. |
Do we really want to process every flyweight change through a DIP? IMO informal Bugzilla ERs are fine for small changes. |
5904f00 to
1da3d87
Compare
1da3d87 to
69ae914
Compare
|
Reopened given the current proliferation of selective imports. |
- fixes the grammar inconsistency that import statements can import multiple modules, but selective imports have to be in separate statements - allow to add further `mod : sym1, sym2` blocks to import statement - only allow non-ambiguous variations (requiring look-ahead of 2 tokens)
69ae914 to
0585416
Compare
|
there's no reason for this limitation to exist and it breaks the rule of least astonishment. no dip needed, please make part of the changelog |
|
@andralex there's already a changelog included. We just need to update dlang.org |
|
This still requires an update to the spec - can we please stop merging PRs that change the language, but haven't opened a PR to dlang.org? |
I gave it a try: dlang/dlang.org#2131 |
|
ignore my previous comment, we could use
grep 'import.*std.range' **/*.d
instead of
egrep 'import(\s+)std.range' **/*.d
…On Fri, Jan 26, 2018 at 6:28 PM, Timothee Cour ***@***.***> wrote:
Something that wasn't raised before: my understanding is that this breaks
grep-based search for imported modules.
I doubt everyone uses dscanner for that. grep based search (or using
ripgrep) is also much faster than dscanner for that (and doesn't require
code to be 100% parsable). There are use cases for both.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#6589 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACF9YAutqvSZjox_Y781TAs1oH4nQ-6sks5tOonZgaJpZM4MTPwm>
.
|
@andralex Anyways this should have at least had a discussion for it. Even if the DIP process was going to be circumvented. Variable declarations can be done on the same line with one type as well. But there's a reason why I and many other programmers don't use it. This is a small change but an un-needed one. It doesn't add anything of value and as Walter said it makes it harder to read. Rule of least astonishment doesn't really apply here anyways, you are going to get a compiler error. One that has a very easy workaround. No broken code is going to end up being compiled and run. After encountering the compiler error once then the user will simply know that that style isn't supported and will continue on using the other styles available. |
|
Example: use
I don't care which symbol is used to separate modules so long it's not |
mod : sym1, sym2blocks to import statement