February 22, 2018
On Wednesday, 21 February 2018 at 18:10:51 UTC, rjframe wrote:
> But it likely shouldn't be used in "real" applications; in particular, I think it would be nice for the Phobos style guide to restrict/disallow its use.

grrr!

better we get some common sense when implementing new stuff ;-)

import std.stdio:write,writeln,writefln & std.array:join,split,replicate;
vs
import std.stdio:write,writeln,writefln,std.array:join,split,replicate;

one is (AFAICT) already implemented, one is not.

one is easy on the eyes (and therefore the brain), and one is not.

one I would actually use, one I would not.

one I would be ok for others to use, one I would not.

can you guess which one applies to each case?

February 22, 2018
you should also mention an important point:
current syntax disallows importing a simple module foo (with no package), eg:

import std.stdio:write,foo; // there's no way to specify a module `foo` import std.stdio:write & foo; // ok

I don't care whether it's `|` or `&` but `,` as a module separator is 100% broken (and illegible, as you mentioned).




On Thu, Feb 22, 2018 at 12:42 AM, psychoticRabbit via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
> On Wednesday, 21 February 2018 at 18:10:51 UTC, rjframe wrote:
>>
>> But it likely shouldn't be used in "real" applications; in particular, I think it would be nice for the Phobos style guide to restrict/disallow its use.
>
>
> grrr!
>
> better we get some common sense when implementing new stuff ;-)
>
> import std.stdio:write,writeln,writefln & std.array:join,split,replicate;
> vs
> import std.stdio:write,writeln,writefln,std.array:join,split,replicate;
>
> one is (AFAICT) already implemented, one is not.
>
> one is easy on the eyes (and therefore the brain), and one is not.
>
> one I would actually use, one I would not.
>
> one I would be ok for others to use, one I would not.
>
> can you guess which one applies to each case?
>
February 22, 2018
On Thursday, 22 February 2018 at 08:42:12 UTC, psychoticRabbit wrote:
>
> import std.stdio:write,writeln,writefln & std.array:join,split,replicate;
> vs
> import std.stdio:write,writeln,writefln,std.array:join,split,replicate;
>

and the rule would be simple.

you can import modules on a single line, seperating each with a comma.
however, an & instead of a comma seperates selective imports from the subsequent import.

import std.stdio, std.algoritm: goDoStuff, goDoMoreStuff & std.conv, std.whatever;

actually, the more I do that, the less I like it.

I would still prefer selective imports to be on their own line:

import std.stdio, std.conv, std.whatever;
import std.algoritm : goDoStuff, goDoMoreStuff;

but in simple case I might use it all on one line:
import std.stdio: write, writeln & std.algorithm: doStuff, doSomeOtherStuff;

but once introduced, programmers will misuse it - guaranteed.

then will just be spending more of our time deciphering import statements.

February 22, 2018
On Tuesday, 20 February 2018 at 22:54:43 UTC, H. S. Teoh wrote:
> On Tue, Feb 20, 2018 at 10:19:03PM +0000, John Gabriele via Digitalmars-d-announce wrote: [...]
>> Thanks. Is the point to be able to string a bunch of selective imports together, as in:
>> 
>>     import pkg.mod1 : sym1, sym2, pkg.mod2 : sym1, sym2, pkg.mod3 : sym1;
>> 
>> ?
>> 
>> That's difficult to read; it's hard to see the difference between the commas that separate the symbols vs the commas that separate the modules+symbols groups.
>
> Yeah, personally I'd avoid writing it that way too.  But obviously enough people like this syntax to push it through. *shrug*
>
>
> T

I'm going to a) never write these imports and b) pretend this feature doesn't exist.

Atila
February 22, 2018
On Thursday, February 22, 2018 09:42:47 Atila Neves via Digitalmars-d- announce wrote:
> On Tuesday, 20 February 2018 at 22:54:43 UTC, H. S. Teoh wrote:
> > On Tue, Feb 20, 2018 at 10:19:03PM +0000, John Gabriele via Digitalmars-d-announce wrote: [...]
> >
> >> Thanks. Is the point to be able to string a bunch of selective
> >>
> >> imports together, as in:
> >>     import pkg.mod1 : sym1, sym2, pkg.mod2 : sym1, sym2,
> >>
> >> pkg.mod3 : sym1;
> >>
> >> ?
> >>
> >> That's difficult to read; it's hard to see the difference between the commas that separate the symbols vs the commas that separate the modules+symbols groups.
> >
> > Yeah, personally I'd avoid writing it that way too.  But obviously enough people like this syntax to push it through. *shrug*
> >
> >
> > T
>
> I'm going to a) never write these imports and b) pretend this
> feature doesn't exist.

Me as well, but unfortunately, if someone uses it in code that you have to deal with, then you can't completely ignore its existence, which is why the argument that "it shouldn't matter if a feature is added that you don't want to use, because you don't have to use it if you don't want to" is bunk. Once a feature is in the language, it affects you even if you never use it. :|

- Jonathan M Davis

February 22, 2018
On Thursday, 22 February 2018 at 09:48:20 UTC, Jonathan M Davis wrote:
> On Thursday, February 22, 2018 09:42:47 Atila Neves via Digitalmars-d- announce wrote:
>> On Tuesday, 20 February 2018 at 22:54:43 UTC, H. S. Teoh wrote:
>> > On Tue, Feb 20, 2018 at 10:19:03PM +0000, John Gabriele via Digitalmars-d-announce wrote: [...]
>> >
>> >> [snip]
> Once a feature is in the language, it affects you even if you never use it. :|

Which is why we should not let it pass. Why didn't this feature go through the usual DIP process?
February 22, 2018
On Thursday, February 22, 2018 09:54:17 Uknown via Digitalmars-d-announce wrote:
> On Thursday, 22 February 2018 at 09:48:20 UTC, Jonathan M Davis
>
> wrote:
> > On Thursday, February 22, 2018 09:42:47 Atila Neves via
> >
> > Digitalmars-d- announce wrote:
> >> On Tuesday, 20 February 2018 at 22:54:43 UTC, H. S. Teoh wrote:
> >> > On Tue, Feb 20, 2018 at 10:19:03PM +0000, John Gabriele via Digitalmars-d-announce wrote: [...]
> >> >
> >> >> [snip]
> >
> > Once a feature is in the language, it affects you even if you never use it. :|
>
> Which is why we should not let it pass. Why didn't this feature go through the usual DIP process?

All I can say for sure is what was said in the PR linked in another post:

https://github.com/dlang/dmd/pull/6589

Based on the comments in the PR, Walter initially opposed it because he didn't like how it looked, but he said nothing after that. However, later, Andrei comments on the PR and thought that it was simply a fix for the current syntax and that it didn't need a DIP and thus approved it. I have no idea if he talked to Walter about it or not, but there is nothing in the PR to indicate that Walter ever changed his mind.

This language change does not appear to have gone through much discussion either. Basically, Martin thought that it was a significant improvement and thus created a PR for it. Walter didn't like it but didn't close it. Almost 10 months later, Andrei sees it and decides that it's a small change which fixes a problem with the syntax and approves it and merges it, clearly thinking that it's not a big deal at all.

- Jonathan M Davis

February 22, 2018
On Thursday, 22 February 2018 at 09:42:47 UTC, Atila Neves wrote:
>
> I'm going to a) never write these imports and b) pretend this feature doesn't exist.
>
> Atila

what about something like this then?

import std.stdio; std.conv: to, from; std.algorithm: doSomething; std.whatever;

just one simple rule; multiple imports on a line are seperated with ;

surely the parser or whatever it's called, could work with that clean and simple solution.

February 22, 2018
On Thursday, February 22, 2018 10:30:44 psychoticRabboit via Digitalmars-d- announce wrote:
> On Thursday, 22 February 2018 at 09:42:47 UTC, Atila Neves wrote:
> > I'm going to a) never write these imports and b) pretend this
> > feature doesn't exist.
> >
> > Atila
>
> what about something like this then?
>
> import std.stdio; std.conv: to, from; std.algorithm: doSomething; std.whatever;
>
> just one simple rule; multiple imports on a line are seperated with ;
>
> surely the parser or whatever it's called, could work with that clean and simple solution.

Honestly, I'm against importing multiple modules on a single line just like I'm against putting multiple variable declarations on a single line. They're harder to read and easier to screw up.

- Jonathan M Davis

February 22, 2018
I still believe it should be something more readable:

import std.stdio, std.conv : [ to, from ], std.algorithm : doSomething, std.whatever;

On Thu, Feb 22, 2018 at 11:30 AM, psychoticRabboit via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:

> On Thursday, 22 February 2018 at 09:42:47 UTC, Atila Neves wrote:
>
>>
>> I'm going to a) never write these imports and b) pretend this feature
>> doesn't exist.
>>
>> Atila
>>
>
> what about something like this then?
>
> import std.stdio; std.conv: to, from; std.algorithm: doSomething; std.whatever;
>
> just one simple rule; multiple imports on a line are seperated with ;
>
> surely the parser or whatever it's called, could work with that clean and simple solution.
>
>