[Issue 14704] The design, which allows not to write import, import, import ... for selective imports

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jun 18 07:49:58 PDT 2015


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

--- Comment #25 from dennis.m.ritchie at mail.ru ---
(In reply to Ketmar Dark from comment #24)
>   import a;
>   import b;
>   import c;
> 
> three lines.
> 
> import {
>   a;
>   b;
>   c;
> }
> 
> five lines.
> 
> i think that discussion can be closed now.

Firstly, the design proposed by me, intended to separate import function
module, and not in order to make this substitution:
import a, b, c;

Secondly, I can write so if at this point I take into your head use this
syntax:
import {
    a, b, c;
}

27 characters (with '\n' 30 characters):

import a;
import b;
import c;

The design proposed by me, not intended for this (15 characters — with '\t' and
'\n' 23 characters):

import {
    a;
    b;
    c;
}

My design solves this problem:

import {
    a : foo;
    b : bar;
    c : baz;
}

My design allows you to write less characters and is more readable than:

import a : foo;
import b : bar;
import c : baz;

--


More information about the Digitalmars-d-bugs mailing list