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.

Reply via email to