aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.lisp')
-rw-r--r--src/utils.lisp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/utils.lisp b/src/utils.lisp
index 0f268be..9e1e46b 100644
--- a/src/utils.lisp
+++ b/src/utils.lisp
@@ -105,9 +105,15 @@ the path."
(defmacro setf-many (&rest places-and-value)
"e.g. (setf-many a b c 10) would set a b and c to 10"
- (let ((value-form
- (first (last places-and-value))))
- `(setf ,@(butlast places-and-value) ,value-form)))
+ (let* ((value-form
+ (first (last places-and-value)))
+ (value
+ (gensym))
+ (clauses
+ (loop for place in (butlast places-and-value)
+ append `(,place ,value))))
+ `(let ((,value ,value-form))
+ (setf ,@clauses))))
(defmacro with-line