Thread overview
import alias
Jul 11, 2004
Simon Hobbs
Jul 11, 2004
C. Sauls
Jul 11, 2004
heretic
Jul 12, 2004
C. Sauls
July 11, 2004
Another idea nicked from C#. I often find that I want to make an alias for an imported namespace and it would be convenient to do it in a single line of code. E.g.

import SomeCompany.SomeLibrary.SomeClass = MyAlias;

instead of:

import SomeCompany.SomeLibrary.SomeClass;
alias SomeCompany.SomeLibrary.SomeClass MyAlias;

I'm very, very lazy :)

Si


July 11, 2004
I like the idea, but would prefer something more like...

import foo.bar.baz as fbz;

-Chris S.
-Invironz

Simon Hobbs wrote:
> Another idea nicked from C#. I often find that I want to make an alias for an
> imported namespace and it would be convenient to do it in a single line of code.
> E.g.
> 
> import SomeCompany.SomeLibrary.SomeClass = MyAlias;
> 
> instead of:
> 
> import SomeCompany.SomeLibrary.SomeClass;
> alias SomeCompany.SomeLibrary.SomeClass MyAlias;
July 11, 2004
In article <ccrijv$176d$1@digitaldaemon.com>, C. Sauls says...
>
>I like the idea, but would prefer something more like...
>
>import foo.bar.baz as fbz;

Exactly. Just like Python does it :)


July 12, 2004
heretic wrote:
> Exactly. Just like Python does it :)

I'm still tempted to request 'from' too... could you imagine:

from std.string import toString as toStr;
from mango.io.FilePath import MutableFilePath as XPath;

-Chris S.
-Invironz