D: What is the difference between targeted and general imports?

If importyou insert something into the D-module, you can write

import std.string;

or

import std.string: format;

Besides the obvious semantic differences, does this have any other effects? For example, binary file size, compilation time, something else?

+3
source share
2 answers

I would add to the ratchet with a ratchet that named imports (or without a name) avoids a clash of names. Having only what you need in the current area, when coding is nice to avoid mistakes and have more freedom when naming things. If you use only import std.string;, you cannot name your variables / functions succ, centeretc.

+2
source

( .d ),

-

+3

All Articles