From: andy Date: Tue, 4 Apr 2000 01:19:07 +0000 (+0000) Subject: [project @ 2000-04-04 01:19:07 by andy] X-Git-Tag: Approximately_9120_patches~4843 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=039fce55118f6a18e5b5cba63ccdd0dfc341894d;p=ghc-hetmet.git [project @ 2000-04-04 01:19:07 by andy] Making expressions inport Prelude, not PrimPrel, fixing the implicit import Prelude back to the Haskell semantics. --- diff --git a/ghc/interpreter/hugs.c b/ghc/interpreter/hugs.c index 7a365b6..f8bb63e 100644 --- a/ghc/interpreter/hugs.c +++ b/ghc/interpreter/hugs.c @@ -9,8 +9,8 @@ * included in the distribution. * * $RCSfile: hugs.c,v $ - * $Revision: 1.53 $ - * $Date: 2000/04/04 01:07:49 $ + * $Revision: 1.54 $ + * $Date: 2000/04/04 01:19:07 $ * ------------------------------------------------------------------------*/ #include @@ -1686,7 +1686,7 @@ static Module allocEvalModule ( void ) module(evalMod).tycons = module(currentModule).tycons; module(evalMod).classes = module(currentModule).classes; module(evalMod).qualImports - = singleton(pair(mkCon(textPrelude),modulePrimPrel)); /* AJG Back to Prelude */ + = singleton(pair(mkCon(textPrelude),modulePrelude)); return evalMod; } diff --git a/ghc/interpreter/static.c b/ghc/interpreter/static.c index 999e1e8..612a57e 100644 --- a/ghc/interpreter/static.c +++ b/ghc/interpreter/static.c @@ -9,8 +9,8 @@ * included in the distribution. * * $RCSfile: static.c,v $ - * $Revision: 1.34 $ - * $Date: 2000/04/04 01:07:49 $ + * $Revision: 1.35 $ + * $Date: 2000/04/04 01:19:07 $ * ------------------------------------------------------------------------*/ #include "hugsbasictypes.h" @@ -5026,6 +5026,7 @@ Void checkContext(void) { /* Top level static check on Expr */ #endif Void checkDefns ( Module thisModule ) { /* Top level static analysis */ + Text modName = module(thisModule).text; staticAnalysis(RESET); @@ -5035,21 +5036,18 @@ Void checkDefns ( Module thisModule ) { /* Top level static analysis */ mapProc(checkQualImport, module(thisModule).qualImports); mapProc(checkUnqualImport,unqualImports); /* Add "import Prelude" if there`s no explicit import */ -#if 0 - if (thisModule==modulePrelude || thisModule == modulePrelude2) { + if (modName == textPrimPrel || modName == textPrelude) { /* Nothing. */ } else if (isNull(cellAssoc(modulePrelude,unqualImports)) && isNull(cellRevAssoc(modulePrelude,module(thisModule).qualImports))) { unqualImports = cons(pair(modulePrelude,DOTDOT),unqualImports); } else { - /* Every module (including the Prelude) implicitly contains - * "import qualified Prelude" + /* Every module implicitly contains "import qualified Prelude" */ module(thisModule).qualImports =cons(pair(mkCon(textPrelude),modulePrelude), module(thisModule).qualImports); } -#endif mapProc(checkImportList, unqualImports); /* Note: there's a lot of side-effecting going on here, so