import except one?

Puming via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 26 22:26:08 PDT 2014


On Thursday, 26 June 2014 at 08:02:24 UTC, bearophile wrote:
> Puming:
>
>> I'm using scriptlike, which imports everything from 
>> std.process for convienience, but I also need to import 
>> another module, which contains a class `Config`, it conflicts 
>> with std.process.Config. I don't actually need 
>> std.process.Config, but I need many other symbols in 
>> scriptlike and std.process.
>>
>> What I want to achieve is to import ALL symbols from 
>> scriptlike EXCEPT std.process.Config, something like:
>>
>> ```d
>> import scriptlike: !Config;
>
> A similar idea is present in Haskell, but it was refused by 
> Walter.

Thanks :-)

I wander what was the rationale behind Walter's rejection.  IMHO 
if we have a selective filter mechanism for imports, the 
complement exclude mechinism works as well.

But of cause we are not that far yet, final, nothrow, pure and 
others don't have their complements either.

>
> The use of scriptlike is going to cause you similar problems, 
> it's not for a fine tuning of imports.

The problem is that we don't have a complete mechanism to fine 
tuning the imports. Selective filtering is only half of the cake.

>
> Bye,
> bearophile



More information about the Digitalmars-d-learn mailing list