the point of selective importing

Rioshin an'Harthen rharth75 at hotmail.com
Tue Jul 11 06:17:38 PDT 2006


"Derek Parnell" <derek at psych.ward> wrote:
> On Tue, 11 Jul 2006 21:12:59 +1000, Rioshin an'Harthen wrote:
>> I thought about it a little more, and came up with the following:
>>
>> import module.name; - current import
>> static import module.name; - require FQN import
>> import module.name alias MN; - current import with automatic alias
>> static import module.name alias MN; - require FQN import with automatic
>> alias
>
> Snap! This was also my suggestion ;-) Additionally, I extended this idea 
> to also allow for selective imports of individual members from the module 
> rather than all the members.
>
>  static import in module.name alias MN member1 alias m1, member2, member3, 
> ... ;
>
>  MN.memb3()
>  MN.m1()

Great minds, eh? :)

I'm giving this a definite thumbs up. Sometimes, it's quite good to only 
import selected members (which I didn't take into account in my post - I 
would probably have come up with something akin to what you show). 





More information about the Digitalmars-d mailing list