From 4ce70f3f2caf05910d43cddd7ce2328ce078585b Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 13 Jun 2022 16:40:39 -0500 Subject: factor out PROG-CHANGES Signed-off-by: Sean Whitton --- src/util.lisp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/util.lisp') diff --git a/src/util.lisp b/src/util.lisp index e20b113..61be8b7 100644 --- a/src/util.lisp +++ b/src/util.lisp @@ -415,6 +415,20 @@ expansion as a starting point for your own DEFPACKAGE form for your consfig." (re:scan "^[a-zA-Z0-9][a-zA-Z0-9-]*$" part))) parts)))) +(defmacro prog-changes (&body body) + (with-gensyms (result) + `(let ((,result :no-change)) + (block prog-changes + (flet ((add-change (&optional result) + (case result + (:no-change result) + (t (setq ,result result)))) + (return-changes () + (return-from prog-changes ,result))) + (declare (ignorable #'return-changes)) + ,@body + ,result))))) + ;;;; Progress & debug printing -- cgit v1.2.3