the point of selective importing

Ameer Armaly ameer_armaly at hotmail.com
Mon Jul 10 17:35:43 PDT 2006


I've been hearing everyone toss around ideas concerning how to selectively 
import symbols from a module, and how to fqn import a module, and I've 
seriously been wondering: why selectively import at all?  Assuming we get 
static import (maybe not with that keyword, but you get the point), what's 
the need for selectively importing if we can just say:

import std.stdio; // I want writefln!
static import cool.module; //Has a toString function for a special type.
static import std.string; //But most of the time I'll be converting ints and 
such to strings, so I shouldn't have to specify.

It might just be me, but IMHO you're trying to mix apples with oranges; 
either you want fully qualified imports or you want standard imports.  If 
you desperately want to mix them, then I agree with Walter in that aliases 
should be just fine; anyone with half a brain will put them right near the 
import where they can be seen; anyone who doesn't do that is just a bad 
coder.
-- 


Ameer
---
Life is either tragedy or comedy. Usually it's your choice. You can whine or 
you can laugh.
--Animorphs 





More information about the Digitalmars-d mailing list