Welcome to the CHICKEN Scheme pasting service

a hack added by megane on Fri Mar 1 11:12:38 2013

diff --git a/library.scm b/library.scm
index 31e1e0c..cbe6bf3 100644
--- a/library.scm
+++ b/library.scm
@@ -4445,16 +4445,27 @@ EOF
 
 (define ##sys#signal-vector (make-vector 256 #f))
 
-(define (##sys#interrupt-hook reason state)
-  (let loop ((reason reason))
-    (cond ((and reason (##sys#slot ##sys#signal-vector reason)) =>
-	   (lambda (handler)
-	     (handler reason)
-	     (loop (##core#inline "C_i_pending_interrupt" #f))))
-	  ((fx> (##sys#slot ##sys#pending-finalizers 0) 0)
-	   (##sys#run-pending-finalizers state) )
-	  ((procedure? state) (state))
-	  (else (##sys#context-switch state) ) ) ) )
+(define ##sys#interrupt-hook
+  (let ((foo #f))
+    (lambda (reason state)
+      (if foo
+	  (begin
+	    (cond ((and reason (##sys#slot ##sys#signal-vector reason)) =>
+		   (lambda (handler)
+		     (handler reason))))
+	    (##sys#context-switch state))
+	  (begin
+	    (set! foo #t)
+	    (let loop ((reason reason))
+	      (cond ((and reason (##sys#slot ##sys#signal-vector reason)) =>
+		     (lambda (handler)
+		       (handler reason)
+		       (loop (##core#inline "C_i_pending_interrupt" #f))))
+		    ((fx> (##sys#slot ##sys#pending-finalizers 0) 0)
+		     (##sys#run-pending-finalizers state) )
+		    ((procedure? state) (state))
+		    (else (##sys#context-switch state) ) ) )
+	    (set! foo #f))))) )
 
 (define (##sys#dispatch-interrupt k)
   (##sys#interrupt-hook

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What's the one-argument procedure to check if a list is empty?
Visually impaired? Let me spell it for you (wav file) download WAV