Commit 2dfc9b54 authored by Attila Lendvai's avatar Attila Lendvai
Browse files

fix: assoc-value setter now always returns the new value

parent aece3dac
......@@ -41,7 +41,7 @@ property list PLIST in the same order."
(get-setf-expansion place env)
(when (cdr newvals)
(error "~A cannot store multiple values in one place" ',name))
(with-unique-names (new-entry key-val test-val alist entry)
(with-unique-names (new-value key-val test-val alist entry)
(append temporary-variables
(list alist
......@@ -53,14 +53,15 @@ property list PLIST in the same order."
`(,',get-entry ,key-val ,alist :test ,test-val)))
(setf (,',get-value-from-entry ,entry) ,new-entry))
(setf (,',get-value-from-entry ,entry) ,new-value))
(let ,newvals
(setf ,(first newvals) (,',add ,key ,new-entry ,alist))
(setf ,(first newvals) (,',add ,key ,new-value ,alist))
`(,',get-value-from-entry ,entry))))))))
(define-alist-get assoc-value assoc cdr acons
"ASSOC-VALUE is an alist accessor very much like ASSOC, but it can
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment