Commit fad75acc authored by sewardj's avatar sewardj
Browse files

[project @ 2000-02-03 13:55:21 by sewardj]

-- Make default defaults work in combined mode
-- rename some fns in lib/Prelude.hs to match names in HugsPrel.lhs
parent a040ea4a
......@@ -9,8 +9,8 @@
* included in the distribution.
*
* $RCSfile: free.c,v $
* $Revision: 1.7 $
* $Date: 1999/11/01 11:07:07 $
* $Revision: 1.8 $
* $Date: 2000/02/03 13:55:21 $
* ------------------------------------------------------------------------*/
#include "prelude.h"
......@@ -92,6 +92,9 @@ static List freeVarsPrimAlt( List acc, StgPrimAlt alt )
static List freeVarsExpr( List acc, StgExpr e )
{
#if 0
printf( "freeVarsExpr: " );ppStgExpr(e);printf("\n");
#endif
switch (whatIs(e)) {
case LETREC:
mapAccum(freeVarsBind,acc,stgLetBinds(e));
......@@ -118,11 +121,9 @@ static List freeVarsExpr( List acc, StgExpr e )
case NAME:
return acc; /* Names are never free vars */
default:
/*
printf("\n");
ppStgExpr(e);
printf("\n");
*/
internal("freeVarsExpr");
}
}
......
......@@ -9,8 +9,8 @@
* included in the distribution.
*
* $RCSfile: hugs.c,v $
* $Revision: 1.36 $
* $Date: 2000/01/12 14:47:27 $
* $Revision: 1.37 $
* $Date: 2000/02/03 13:55:21 $
* ------------------------------------------------------------------------*/
#include <setjmp.h>
......@@ -1389,7 +1389,7 @@ static Void local evaluator() { /* evaluate expr and print value */
/* allocated during evaluation */
parseExp();
checkExp();
defaultDefns = evalDefaults;
defaultDefns = combined ? stdDefaults : evalDefaults;
type = typeCheckExp(TRUE);
if (isPolyType(type)) {
......
......@@ -1561,8 +1561,8 @@ hugsprimPmDouble :: Fractional a => Double -> a -> Bool
hugsprimPmDouble n x = fromDouble n == x
-- ToDo: make the message more informative.
primPmFail :: a
primPmFail = error "Pattern Match Failure"
hugsprimPmFail :: a
hugsprimPmFail = error "Pattern Match Failure"
-- used in desugaring Foreign functions
hugsprimMkIO :: (RealWorld -> (a,RealWorld)) -> IO a
......
......@@ -9,8 +9,8 @@
* included in the distribution.
*
* $RCSfile: link.c,v $
* $Revision: 1.38 $
* $Date: 2000/01/12 16:29:47 $
* $Revision: 1.39 $
* $Date: 2000/02/03 13:55:21 $
* ------------------------------------------------------------------------*/
#include "prelude.h"
......@@ -509,6 +509,7 @@ Void linkControl(what)
Int what; {
Int i;
switch (what) {
//case EXIT : fooble();break;
case RESET :
case MARK :
break;
......@@ -516,9 +517,7 @@ Int what; {
case POSTPREL: {
Module modulePrelBase = findModule(findText("PrelBase"));
assert(nonNull(modulePrelBase));
#if 1
fprintf(stderr, "linkControl(POSTPREL)\n");
#if 1
setCurrModule(modulePrelude);
linkPreludeTC();
linkPreludeCM();
......@@ -526,8 +525,43 @@ Int what; {
nameUnpackString = linkName("hugsprimUnpackString");
namePMFail = linkName("hugsprimPmFail");
#endif
#endif
#define xyzzy(aaa,bbb) aaa = linkName(bbb)
/* pmc */
xyzzy(nameSel, "_SEL");
/* newtype and USE_NEWTYPE_FOR_DICTS */
xyzzy(nameId, "id");
/* strict constructors */
xyzzy(nameFlip, "flip" );
/* parser */
xyzzy(nameFromTo, "enumFromTo");
xyzzy(nameFromThenTo, "enumFromThenTo");
xyzzy(nameFrom, "enumFrom");
xyzzy(nameFromThen, "enumFromThen");
/* deriving */
xyzzy(nameApp, "++");
xyzzy(nameReadField, "readField");
xyzzy(nameReadParen, "readParen");
xyzzy(nameShowField, "showField");
xyzzy(nameShowParen, "showParen");
xyzzy(nameLex, "lex");
xyzzy(nameComp, ".");
xyzzy(nameAnd, "&&");
xyzzy(nameCompAux, "primCompAux");
xyzzy(nameMap, "map");
/* implementTagToCon */
xyzzy(nameError, "error");
typeStable = linkTycon("Stable");
typeRef = linkTycon("IORef");
// {Prim,PrimByte,PrimMutable,PrimMutableByte}Array ?
break;
}
case PREPREL :
......@@ -565,7 +599,8 @@ Int what; {
pair(STAR,pair(STAR,STAR)),
2,DATATYPE,NIL);
pFun(nameInd, "_indirect");
/* desugaring */
pFun(nameInd, "_indirect");
name(nameInd).number = DFUNNAME;
} else {
......@@ -671,5 +706,5 @@ Int what; {
}
#undef pFun
#include "fooble.c"
/*-------------------------------------------------------------------------*/
......@@ -9,8 +9,8 @@
* included in the distribution.
*
* $RCSfile: type.c,v $
* $Revision: 1.22 $
* $Date: 2000/01/12 14:52:54 $
* $Revision: 1.23 $
* $Date: 2000/02/03 13:55:22 $
* ------------------------------------------------------------------------*/
#include "prelude.h"
......@@ -2807,6 +2807,7 @@ Int what; {
nameUnit = findQualNameWithoutConsultingExportList
(mkQVar(findText("PrelBase"),
findText("()")));
typeVarToVar = fn(aVar,aVar);
}
break;
......
......@@ -1561,8 +1561,8 @@ hugsprimPmDouble :: Fractional a => Double -> a -> Bool
hugsprimPmDouble n x = fromDouble n == x
-- ToDo: make the message more informative.
primPmFail :: a
primPmFail = error "Pattern Match Failure"
hugsprimPmFail :: a
hugsprimPmFail = error "Pattern Match Failure"
-- used in desugaring Foreign functions
hugsprimMkIO :: (RealWorld -> (a,RealWorld)) -> IO a
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment