diff options
Diffstat (limited to 'ice-9/hooks.scm')
-rw-r--r-- | ice-9/hooks.scm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ice-9/hooks.scm b/ice-9/hooks.scm new file mode 100644 index 000000000..a6e4f6c6b --- /dev/null +++ b/ice-9/hooks.scm @@ -0,0 +1,23 @@ +;;; {Hooks} +;;; +;;; Warning: Hooks are now first class objects and add-hook! and remove-hook! +;;; procedures. This interface is only provided for backward compatibility +;;; and will be removed. +;;; +(module-open (ice-9 guile)) +(if (not (defined? new-add-hook!)) + (begin + (define new-add-hook! add-hook!) + (define new-remove-hook! remove-hook!))) + +(define (run-hooks hook) + (if (and (pair? hook) (eq? (car hook) 'hook)) + (run-hook hook) + (for-each (lambda (thunk) (thunk)) hook))) + +(define *suppress-old-style-hook-warning* #f) + +(define abort-hook (make-hook)) + + + |