This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

suggestion: remove-hook!



How about adding this to boot-9.scm, to complement add-hook!:

--- boot-9.scm  Mon Jan  5 17:10:10 1998
+++ boot-9.scm.2        Fri Mar 27 14:12:30 1998
@@ -550,6 +550,14 @@
             (set! ,(cadr exp)
                   (cons thunk ,(cadr exp))))))))
 
+(define remove-hook!
+  (procedure->macro
+    (lambda (exp env)
+      `(let ((thunk ,(caddr exp)))
+        (if (memq thunk ,(cadr exp)))
+            (set! ,(cadr exp)
+                  (delq! thunk ,(cadr exp)))))))
+
 

 ;;; {Files}
 ;;;