Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Momchil Ivanov
alexandria
Commits
2dfc9b54
Commit
2dfc9b54
authored
Feb 17, 2010
by
Attila Lendvai
Browse files
fix: assoc-value setter now always returns the new value
parent
aece3dac
Changes
1
Hide whitespace changes
Inline
Side-by-side
lists.lisp
View file @
2dfc9b54
...
...
@@ -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
)
(
values
(
append
temporary-variables
(
list
alist
...
...
@@ -53,14 +53,15 @@ property list PLIST in the same order."
key
test
`
(
,
',get-entry
,
key-val
,
alist
:test
,
test-val
)))
`
(
,
new-
entry
)
`
(
,
new-
value
)
`
(
cond
(
,
entry
(
setf
(
,
',get-value-from-entry
,
entry
)
,
new-
entry
))
(
setf
(
,
',get-value-from-entry
,
entry
)
,
new-
value
))
(
t
(
let
,
newvals
(
setf
,
(
first
newvals
)
(
,
',add
,
key
,
new-entry
,
alist
))
,
setter
)))
(
setf
,
(
first
newvals
)
(
,
',add
,
key
,
new-value
,
alist
))
,
setter
,
new-value
)))
`
(
,
',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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment