* in the distribution for details.
*
* $RCSfile: storage.h,v $
- * $Revision: 1.3 $
- * $Date: 1999/02/03 17:08:41 $
+ * $Revision: 1.5 $
+ * $Date: 1999/03/09 14:51:14 $
* ------------------------------------------------------------------------*/
/* --------------------------------------------------------------------------
extern Bool isQualIdent Args((Cell));
extern Bool isIdent Args((Cell));
-#if 0
-Originally ...
-#define isFloat(c) (isPair(c) && fst(c)==FLOATCELL)
-extern Cell mkFloat Args((FloatPro));
-extern FloatPro floatOf Args((Cell));
-extern String floatToString Args((FloatPro));
-extern FloatPro stringToFloat Args((String));
-#else
-#define isFloat(c) (isPair(c) && fst(c)==FLOATCELL)
-#define stringToFloat(s) pair(FLOATCELL,findText(s))
-#define floatToString(f) textToStr(snd(f))
-#define floatEq(f1,f2) (snd(f1) == snd(f2))
-#define floatNegate(f) stringToFloat(stringNegate(floatToString(f)))
-#define floatOf(f) atof(floatToString(f))
-#endif
-
-
-
+extern String stringNegate Args((String));
#define isFloat(c) (isPair(c) && fst(c)==FLOATCELL)
#define stringToFloat(s) pair(FLOATCELL,findText(s))
#define floatToString(f) textToStr(snd(f))
-#define floatEq(f1,f2) (snd(f1) == snd(f2))
-#define floatNegate(f) stringToFloat(stringNegate(floatToString(f)))
#define floatOf(f) atof(floatToString(f))
#define mkFloat(f) (f) /* ToDo: is this right? */
+#define floatNegate(f) stringToFloat(stringNegate(floatToString(f)))
#define bignumToString(b) textToStr(snd(b))
#define STGPRIM 94 /* STGPRIM snd :: (PrimOp,[Arg]) */
#define STGCON 95 /* STGCON snd :: (StgCon,[Arg]) */
#define PRIMCASE 96 /* PRIMCASE snd :: (Expr,[PrimAlt]) */
-
/* Last constructor tag must be less than SPECMIN */
/* --------------------------------------------------------------------------
Kind kind; /* kind (includes arity) of Tycon */
Cell what; /* DATATYPE/SYNONYM/RESTRICTSYN... */
Cell defn;
+ Name conToTag; /* used in derived code */
+ Name tagToCon;
Tycon nextTyconHash;
};
#define mfunOf(n) ((-1)-name(n).number)
#define mfunNo(i) ((-1)-(i))
-extern Name newName Args((Text,Cell));
-extern Name findName Args((Text));
-extern Name addName Args((Name));
-extern Name findQualName Args((Cell));
-extern Name addPrimCfun Args((Text,Int,Int,Int));
-extern Int sfunPos Args((Name,Name));
+extern Name newName Args((Text,Cell));
+extern Name findName Args((Text));
+extern Name addName Args((Name));
+extern Name findQualName Args((Cell));
+extern Name addPrimCfun Args((Text,Int,Int,Cell));
+extern Name addPrimCfunREP Args((Text,Int,Int,Int));
+extern Int sfunPos Args((Name,Name));
/* --------------------------------------------------------------------------
* Type class values:
struct strInst {
Class c; /* class C */
Int line;
- Module mod; /* module that defines it */
+ //Module mod; /* module that defines it */
Kinds kinds; /* Kinds of variables in head */
Cell head; /* :: Pred */
List specifics; /* :: [Pred] */
extern List dupList Args((List));
extern List revOnto Args((List, List)); /* destructive */
#define rev(xs) revOnto((xs),NIL) /* destructive */
+#define reverse(xs) revOnto(dupList(xs),NIL) /* non-destructive */
extern Cell cellIsMember Args((Cell,List));
extern Cell cellAssoc Args((Cell,List));
extern Cell cellRevAssoc Args((Cell,List));
extern List splitAt Args((Int,List)); /* non-destructive */
extern Cell nth Args((Int,List));
extern List removeCell Args((Cell,List)); /* destructive */
+extern List dupListOnto Args((List,List)); /* non-destructive */
/* The following macros provide `inline expansion' of some common ways of
* traversing, using and modifying lists: