Exclusive Imports

. . a at b.c
Thu Jan 10 21:37:01 UTC 2019


Is there a way to import all symbols from a module, excluding one 
symbol?

For example, lets say I am using std.file and std.stdio in the 
same scope (both of which have a symbol "write"). I need to use 
the "write" from std.file. I am using *a lot* of different 
functions from both std.stdio and std.file, so a selective import 
for everything except "write" would be too long and inefficient. 
I need to import everything from std.stdio *except* "write". I 
was hoping something like this was possible: `import std.stdio : 
!write;`. I also was thinking about just doing a renamed import 
and renaming std.stdio.write to some other name that will never 
be used, but that is not such a good idea because it still 
pollutes the namespace.

Is there a better way to do exclusive imports? If not, any 
thoughts on adding exclusive imports to D?


More information about the Digitalmars-d mailing list