On Mon, 06 Oct 2014 21:24:54 +0000
AsmMan via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com>
wrote:

> Which practice do you use: if you need only one or two functions 
> from a module:
> 
> import myModule : func, func2;
> 
> or (import whole module, assuming no function name conflits of 
> course)
> 
> import myModule;
> 
> any words why one over the other are welcome.
in C days i was writting something like this:

  #include "something.h"  // i need foo() and bar()

in D such comments can be turned to direct instructions to the
compiler. ;-)

i tend to import "std.stdio" and "std.string" as a whole at the top of
the module (sometimes some other "std." also), and doing local imports
with explicit function enumeration when i need something from other
modules. local imports rocks! ;-)

Attachment: signature.asc
Description: PGP signature

Reply via email to