[project @ 2000-04-11 11:06:34 by simonmar]
[ghc-hetmet.git] / ghc / interpreter / compiler.c
index 53f3708..ac85831 100644 (file)
  * included in the distribution.
  *
  * $RCSfile: compiler.c,v $
- * $Revision: 1.23 $
- * $Date: 2000/03/15 23:27:16 $
+ * $Revision: 1.26 $
+ * $Date: 2000/04/06 14:23:55 $
  * ------------------------------------------------------------------------*/
 
-#include "prelude.h"
+#include "hugsbasictypes.h"
 #include "storage.h"
 #include "connect.h"
 #include "errors.h"
@@ -847,7 +847,7 @@ List lds; {
                          }
 
         case DICTVAR   : /* shouldn't really occur */
-                         assert(0); /* so let's test for it then! ADR */
+         //assert(0); /* so let's test for it then! ADR */
         case VARIDCELL :
         case VAROPCELL : return addEqn(pat,expr,lds);
 
@@ -865,10 +865,15 @@ List lds; {
                          /* intentional fall-thru */
         case TUPLE     : {   List ps = getArgs(pat);
 
+                             /* get rid of leading dictionaries in args */
+                             if (isName(c) && isCfun(c)) {
+                                Int i = numQualifiers(name(c).type);
+                                for (; i > 0; i--) ps = tl(ps);
+                             }
+
                              if (nonNull(ps)) {
                                  Cell nv, sel;
                                  Int  i;
-
                                  if (isVar(expr) || isName(expr))
                                      nv  = expr;
                                  else {
@@ -1462,15 +1467,6 @@ static List addGlobals( List binds )
     return binds;
 }
 
-typedef void (*sighandler_t)(int);
-void eval_ctrlbrk ( int dunnowhat )
-{
-   interruptStgRts();
-   /* reinstall the signal handler so that further interrupts which
-      happen before the thread can return to the scheduler, lead back
-      here rather than invoking the previous break handler. */
-   signal(SIGINT, eval_ctrlbrk);
-}
 
 Void evalExp ( void ) {             /* compile and run input expression    */
     /* ToDo: this name (and other names generated during pattern match?)
@@ -1494,19 +1490,17 @@ Void evalExp ( void ) {             /* compile and run input expression    */
        unless doRevertCAFs below is permanently TRUE.
      */
     /* initScheduler(); */
-#ifdef CRUDE_PROFILING
+#   ifdef CRUDE_PROFILING
     cp_init();
-#endif
+#   endif
 
     {
         HaskellObj      result; /* ignored */
-        sighandler_t    old_ctrlbrk;
         SchedulerStatus status;
         Bool            doRevertCAFs = TRUE;  /* do not change -- comment above */
-        old_ctrlbrk         = signal(SIGINT, eval_ctrlbrk);
-        ASSERT(old_ctrlbrk != SIG_ERR);
+        HugsBreakAction brkOld = setBreakAction ( HugsRtsInterrupt ); 
         status              = rts_eval_(closureOfVar(v),10000,&result);
-        signal(SIGINT,old_ctrlbrk);
+        setBreakAction ( brkOld );
         fflush (stderr); 
         fflush (stdout);
         switch (status) {