From 5654b8b4c30fd783dd1d1d1eb716e4f21c0ac83e Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Fri, 15 Jul 2022 17:10:33 -0500 Subject: [bugfix] in ww::setf-many; [example] fiddling with example 10 --- src/utils.lisp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/utils.lisp') 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 -- cgit v1.2.3