[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
Wed Jun 17 08:30:39 PDT 2015


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

--- Comment #4 from dennis.m.ritchie at mail.ru ---
(In reply to Ketmar Dark from comment #3)
> [...]

OK. I formulate the question differently :) If D add the following syntax:

import {
    std.math,
    std.conv,
    std.stdio : doutln = writeln, dout = write;
    std.ascii,
    std.range : iota, retro;
    std.array : array;
    std.regex,
    std.format : format;
    std.bigint : big = BigInt;
    std.traits,
    std.random : uniform;
    std.string : split;
    std.numeric,
    std.variant,
    std.typecons,
    std.container,
    std.algorithm,
    std.typetuple,
    std.exception,
    core.checkedint;
}

Surely then you will continue to write it? :o)

import std.math;
import std.conv;
import std.stdio : doutln = writeln, dout = write;
import std.ascii;
import std.range : iota, retro;
import std.array : array;
import std.regex;
import std.format : format;
import std.bigint : big = BigInt;
import std.traits;
import std.random : uniform;
import std.string : split;
import std.numeric;
import std.variant;
import std.typecons;
import std.container;
import std.algorithm;
import std.typetuple;
import std.exception;
import core.checkedint;

At the moment, I do not import some functions because it is very time consuming
for each Olympiad programming write `import`,` import`, `import`.
And if you have this problem does not occur, it does not mean that it does not
arise from the thousands of other people. And I see that Olympiad C ++
programmers write `#include`, #include`,` #include`.
The D is a good modular system, so why should we continue to write as in C++,
but not in Go.

Did I suggest something bad? Something leading to the past? After D plans to
become easier and more powerful than C++. And this design will make it even
easier to use D. It starts with small things, but not with any global problems.
Not made in one place easier and better, then why do better elsewhere? There
was even no progress without some little things...

--


More information about the Digitalmars-d-bugs mailing list