diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-06-13 16:40:39 -0500 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-06-14 14:21:17 -0700 |
commit | 4ce70f3f2caf05910d43cddd7ce2328ce078585b (patch) | |
tree | 7656cca809c923dcfa8708ff4a0bbb69f6d9485a /src/util.lisp | |
parent | 9838876de707deca3ea92f3150d1e62f34f3fc51 (diff) | |
download | consfigurator-4ce70f3f2caf05910d43cddd7ce2328ce078585b.tar.gz |
factor out PROG-CHANGES
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/util.lisp')
-rw-r--r-- | src/util.lisp | 14 |
1 files changed, 14 insertions, 0 deletions
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 |