* Hugs version 1.4, December 1997
*
* $RCSfile: interface.c,v $
- * $Revision: 1.21 $
- * $Date: 2000/01/07 10:29:59 $
+ * $Revision: 1.25 $
+ * $Date: 2000/01/11 14:56:07 $
* ------------------------------------------------------------------------*/
#include "prelude.h"
/* ifaces_outstanding holds a list of parsed interfaces
for which we need to load objects and create symbol
table entries.
+
+ Return TRUE if Prelude `elem` ifaces_outstanding, else FALSE.
*/
-Void processInterfaces ( void )
+Bool processInterfaces ( void )
{
List tmp;
List xs;
Module mod;
List all_known_types;
Int num_known_types;
+ Bool didPrelude;
List ifaces = NIL; /* :: List I_INTERFACE */
List iface_sizes = NIL; /* :: List Int */
List iface_onames = NIL; /* :: List Text */
- if (isNull(ifaces_outstanding)) return;
+ if (isNull(ifaces_outstanding)) return FALSE;
fprintf ( stderr,
"processInterfaces: %d interfaces to process\n",
calling the finishGHC* functions. But don't process
the export lists; those must wait for later.
*/
+ didPrelude = FALSE;
for (xs = ifaces; nonNull(xs); xs = tl(xs)) {
iface = unap(I_INTERFACE,hd(xs));
mname = textOf(zfst(iface));
setCurrModule(mod);
ppModule ( module(mod).text );
+ if (mname == textPrelude) didPrelude = TRUE;
+
for (decls = zsnd(iface); nonNull(decls); decls = tl(decls)) {
Cell decl = hd(decls);
switch(whatIs(decl)) {
/* Finished! */
ifaces_outstanding = NIL;
+
+ return didPrelude;
}
c = findQualTyconWithoutConsultingExportList ( q );
if (isNull(c)) goto notfound;
fprintf(stderr, " type %s\n", textToStr(textOf(ex)) );
- module(mod).exports = cons(c, module(mod).exports);
+ module(mod).exports = cons(pair(c,NIL), module(mod).exports);
addTycon(c);
break;
original (defining) module.
*/
if (abstract) {
- module(mod).exports = cons(c, module(mod).exports);
+ module(mod).exports = cons(pair(c,NIL), module(mod).exports);
addTycon(c);
fprintf ( stderr, "(abstract) ");
} else {
c = findQualNameWithoutConsultingExportList ( q );
fprintf(stderr, "%s ", textToStr(name(c).text));
assert(nonNull(c));
- module(mod).exports = cons(c, module(mod).exports);
+ /* module(mod).exports = cons(c, module(mod).exports); */
addName(c);
}
}
c = findQualNameWithoutConsultingExportList ( q );
fprintf(stderr, "%s ", textToStr(name(c).text));
if (isNull(c)) goto notfound;
- module(mod).exports = cons(c, module(mod).exports);
+ /* module(mod).exports = cons(c, module(mod).exports); */
addName(c);
}
fprintf(stderr, "}\n" );
}
n = newName(v,NIL);
- /* convert a leading run of DICTAPs into Hugs' internal Qualtype form, viz:
- { C1 a } -> { C2 b } -> T into
- ap(QUALTYPE, ( [(C1,a),(C2,b)], T ))
- */
ty = dictapsToQualtype(ty);
tvs = ifTyvarsIn(ty);
Name mn;
/* Stick the new context on the member type */
+ memT = dictapsToQualtype(memT);
if (whatIs(memT)==POLYTYPE) internal("startGHCClass");
if (whatIs(memT)==QUAL) {
memT = pair(QUAL,
name(n).line = cclass(nw).line;
name(n).type = ty;
name(n).number = ctr++;
+ name(n).arity = arityInclDictParams(name(n).type);
hd(mems) = n;
}
}
inst(in).c = cl;
}
-#if 0
- Is this still needed?
{
- Name b = newName(inventText(),NIL);
+ Name b = newName( /*inventText()*/ textOf(var),NIL);
name(b).line = line;
- name(b).arity = length(ctxt); /* unused? */
+ name(b).arity = length(spec); /* unused? */ /* and surely wrong */
name(b).number = DFUNNAME;
inst(in).builder = b;
- bindNameToClosure(b, lookupGHCClosure(inst(in).mod,var));
+ /* bindNameToClosure(b, lookupGHCClosure(inst(in).mod,var)); */
}
-#endif
+
return in;
}