From 039fce55118f6a18e5b5cba63ccdd0dfc341894d Mon Sep 17 00:00:00 2001 From: andy <unknown> Date: Tue, 4 Apr 2000 01:19:07 +0000 Subject: [PATCH] [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. --- ghc/interpreter/hugs.c | 6 +++--- ghc/interpreter/static.c | 12 +++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/ghc/interpreter/hugs.c b/ghc/interpreter/hugs.c index 7a365b66b18a..f8bb63e21228 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 <setjmp.h> @@ -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 999e1e8d4a87..612a57eb208d 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 -- GitLab