And what will we do about package?

Don nospam at nospam.com
Fri Nov 20 23:53:25 PST 2009


Vladimir Panteleev wrote:
> On Fri, 20 Nov 2009 18:52:09 +0200, Don <nospam at nospam.com> wrote:
> 
>> module first.second.third.fourth;
>>  which package is this module part of?
>> Is it 'third', 'second.third', or 'first.second.third'?
> 
> Perhaps you meant: 'first', 'first.second', or 'first.second.third'?


> 
> The case you mention presents an immediate ambiguity, but it is 
> clarified by the module declaration or on the first import. If 
> 'first.second.foo' imports 'first.second.third.bar' by 'import 
> third.bar', and 'first.second.third.bar' has a module declaration or is 
> imported from somewhere else using a different package "path", the 
> compiler will generate an error ("Error: module X is in multiple 
> packages Y")

How do you define module fourth so that its 'package' functions are 
accesssable only to modules in first.second.* and not in first.* ?




More information about the Digitalmars-d mailing list