questions on PhanTango 'merger' (was Merging Tangobos into Tango)- long-term vision
Chad J
gamerChad at _spamIsBad_gmail.com
Thu Oct 11 22:17:27 PDT 2007
BCS wrote:
>
> I think you can uses aliases in other files.
>
>
I just tested it, and apparently I'm wrong.
In fact, I'm glad I'm wrong.
I think I know what the snag was now. Something to the opposite effect.
Aliases can't be hidden at a module level, even by private.
// imp.d
private alias int Foo;
// main.d
import imp;
void main()
{
Foo bar = 3;
}
// Compiles and runs.
Interestingly, aliases can be hidden by placing them in other
constructs. Just change imp.d to the following:
//imp.d
private struct Baz
{
alias int Foo;
Foo member;
}
Then the desired compile failure happens. Even so, it can be
circumvented by writing Baz.Foo in main(). Given this cursory
inspection, it seems that there is no way to completely hide aliases.
I'm not sure how I feel about that.
More information about the Digitalmars-d
mailing list