Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
November 03, 2008 Module renaming ignored when also using selective import | ||||
---|---|---|---|---|
| ||||
Attachments: | Hi! I'm using DMD 1.033 (with tangobos), so I'm not really sure about this one. But when I both rename and use a selective import, the renaming doesn't seem to have any effect: import mystdout = tango.io.Stdout : Stdout; void main() { Stdout("Should require mystdout prefix?"); } The above code compiles and runs just fine. Same code attached to the post. Thank you for a great language! -Seb |
November 04, 2008 Re: Module renaming ignored when also using selective import | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sebastian Lundstrom | > import mystdout = tango.io.Stdout : Stdout; > void main() > { > Stdout("Should require mystdout prefix?"); > } No, this behaves as specified: you get Stdout from the selective import and tango.io.Stdout as mystdout from the rename. See 'Renamed and Selective Imports' in http://www.digitalmars.com/d/1.0/module.html#ImportDeclaration . |
November 04, 2008 Re: Module renaming ignored when also using selective import | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christian Kamm | Christian Kamm Wrote:
> > import mystdout = tango.io.Stdout : Stdout;
> > void main()
> > {
> > Stdout("Should require mystdout prefix?");
> > }
>
> No, this behaves as specified: you get Stdout from the selective import and
> tango.io.Stdout as mystdout from the rename. See 'Renamed and Selective
> Imports' in
> http://www.digitalmars.com/d/1.0/module.html#ImportDeclaration .
Ah, my bad!
-Seb
|
November 04, 2008 Re: Module renaming ignored when also using selective import | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christian Kamm | Christian Kamm:
> > import mystdout = tango.io.Stdout : Stdout;
> > void main()
> > {
> > Stdout("Should require mystdout prefix?");
> > }
>
> No, this behaves as specified: you get Stdout from the selective import and tango.io.Stdout as mystdout from the rename.
I think that's a bit confusing syntax.
Bye,
bearophile
|
November 04, 2008 Re: Module renaming ignored when also using selective import | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sebastian Lundstrom | On Mon, 03 Nov 2008 15:37:09 -0500, Sebastian Lundstrom <tretton@gmail.com> wrote: >import mystdout = tango.io.Stdout : Stdout; > void main() > { > Stdout("Should require mystdout prefix?"); > } D is behaving as expected, see the section 'Renamed and Selective Imports'. http://www.digitalmars.com/d/2.0/module.html Gide |
Copyright © 1999-2021 by the D Language Foundation