DIP16: Transparently substitute module with package
    Steven Schveighoffer 
    schveiguy at yahoo.com
       
    Thu Apr  5 07:55:42 PDT 2012
    
    
  
On Fri, 30 Mar 2012 10:46:19 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:
> Starting a new thread from one in announce:
>
> http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP16
>
> Please comment, after which Walter will approve. Walter's approval means  
> that he would approve a pull request implementing DIP16 (subject to  
> regular correctness checks).
>
>
> Destroy!
BTW, this case makes the part of DIP16 which wants to shortcut fully  
qualified names invalid, or at least costly (I posted this code in another  
part of the thread, but I thought I'd bring it up higher).
The following is valid code today:
a/b.d:
module a.b;
void foo() {}
struct b
{
    static void foo() {}
}
main.d:
import a.b;
void main()
{
    a.b.foo();
}
If DIP16 were to be implemented, this becomes ambiguous.  Is a.b.foo() the  
module function foo() from a.b, or is it a shortcut for a.b.b.foo()?
The main issue is, because you can shortcut the FQN, and a chain of  
identifiers can have repeated identifiers in them, ambiguity is possible.
Michel Fortin pointed out at least three cases of this in phobos (although  
I can't see how they could be ambiguous, he has a good point).
-Steve
    
    
More information about the Digitalmars-d
mailing list