Changes between Version 21 and Version 22 of Commentary/Packages/GhcPackagesProposal


Ignore:
Timestamp:
Jul 6, 2006 3:50:34 PM (9 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Packages/GhcPackagesProposal

    v21 v22  
    7878=== Importing from the home package === 
    7979 
    80 If A.B.C is in the package being compiled (which we call "the home package"), and in an exposed package, and you say {{{import A.B.C}}}, do you get an "ambiguous import" error , or does the current package override.  And if the former, how can you say "import A.B.C from the current package"? 
     80If A.B.C is in the package being compiled (which we call "the home package"), and in an exposed package, and you say {{{import A.B.C}}}, do you get an "ambiguous import" error , or does the current package override.  And if the former, how can you say "import A.B.C from the current package"?   
     81 
     82One possibility is to reuqire the code to know its own package name, and mention that in the import. For exmaple, in a module that is being compiled as part package "foo", you'd say {{{import A.B.C from "foo"}}}.  What about modules that are part of the main program (not a package at all).  Perhaps you could then say {{{import A.B.C from "main"}}}. 
     83 
     84Another way is to have a special package name meaning "the home package".  The special name could be 
     85 * "" 
     86 * "home" 
     87 * "this" 
     88 * this (with no quotes) 
    8189 
    8290=== The 'as P' alias ===