;;; pre-exit-hooks.lisp (in-package :wheelwork) (defvar *pre-exit-hooks* (make-hash-table)) (defun pre-exit-hook-exists-p (tag) (gethash tag *pre-exit-hooks*)) (defun pre-exit-hook (tag thunk) (setf (gethash tag *pre-exit-hooks*) thunk)) (defun pre-exit-hooks () (loop for thunk being the hash-value of *pre-exit-hooks* do (funcall thunk)))