Thread overview | ||||||
---|---|---|---|---|---|---|
|
July 11, 2004 import alias | ||||
---|---|---|---|---|
| ||||
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 Re: import alias | ||||
---|---|---|---|---|
| ||||
Posted in reply to Simon Hobbs | 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 Re: import alias | ||||
---|---|---|---|---|
| ||||
Posted in reply to C. Sauls | 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 Re: import alias | ||||
---|---|---|---|---|
| ||||
Posted in reply to heretic | 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
|
Copyright © 1999-2021 by the D Language Foundation