And what will we do about package?

Vladimir Panteleev thecybershadow at gmail.com
Fri Nov 20 23:22:24 PST 2009


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")

-- 
Best regards,
  Vladimir                          mailto:thecybershadow at gmail.com



More information about the Digitalmars-d mailing list