[Issue 13855] Allow multiple selective imports from different modules in a single import statement

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Dec 11 16:32:14 PST 2014


https://issues.dlang.org/show_bug.cgi?id=13855

--- Comment #3 from Martin Nowak <code at dawg.eu> ---
(In reply to bearophile_hugs from comment #2)
> (In reply to Martin Nowak from comment #0)
> > Couldn't we just allow this?
> > 
> >     import std.algorithm : copy, uniq, std.range : walkLength;
> > 
> > This is one of (very few) grammar warts that regularly annoy me, because I
> > have to make it 2 lines
> > 
> >     import std.algorithm : copy, uniq;
> >     import std.range : walkLength;
> 
> I prefer the version on two lines, because it's not easy for the eye to tell
> apart the ":" from the ",".

I do agree with you, although most module names have a dot in the middle, and
syntax highlighting could take of the rest.
But your argument actually misses the point. Imports are on the noise side of
S/N ratio when reading code. They can usually be skipped unless one actually
wants to know where a symbol comes from.
So in the above example, a seasoned programmer will already know what partion3,
schwarzSort, levenshteinDistance, and toUpper do and can focus on the complex
parts.

--


More information about the Digitalmars-d-bugs mailing list