private alias for module

Extrawurst spam at extrawurst.org
Tue Aug 14 09:06:24 PDT 2007


what abot that ?

import std.string:toString;
alias toString str;


Myron Alexander schrieb:
> Chris Nicholson-Sauls wrote:
>> I'm not sure what the reasoning is, and would just assume have 
>> private aliases as well. But I can add another option.  Assuming you 
>> just want std.string.* to have a shorter name, you could try a 
>> static+renaming import.
>>
>> static import str = std.string;
>> // ...
>> str.toString(50);
>>
>> If its something else you're after... then I don't know.
>>
>> -- Chris Nicholson-Sauls
>
> Chris,
>
> I do not want to rename the module, I want to use "str" instead of 
> "toString". The alias is a natural solution but I do not want it 
> imported into the caller name space.
>
> Regards,
>
> Myron.


More information about the Digitalmars-d-learn mailing list