projects
/
jscl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c79c3ad
)
Only evaluate place in POP once
author
Owen Rodley
<Strigoides@gmail.com>
Fri, 26 Apr 2013 22:03:43 +0000
(10:03 +1200)
committer
Owen Rodley
<Strigoides@gmail.com>
Fri, 26 Apr 2013 22:03:43 +0000
(10:03 +1200)
src/list.lisp
patch
|
blob
|
history
diff --git
a/src/list.lisp
b/src/list.lisp
index
ddaeb56
..
0f95f42
100644
(file)
--- a/
src/list.lisp
+++ b/
src/list.lisp
@@
-56,7
+56,11
@@
(t tree)))
(defmacro pop (place)
(t tree)))
(defmacro pop (place)
- (let ((car-symbol (gensym)))
- `(let ((,car-symbol (car ,place)))
- (setf ,place (cdr ,place))
- ,car-symbol)))
+ (multiple-value-bind (dummies vals newval setter getter)
+ (get-setf-expansion place)
+ (let ((car-symbol (gensym)))
+ `(let* (,@(mapcar #'list dummies vals)
+ (,car-symbol (car ,getter))
+ (,(car newval) (cdr ,getter)))
+ ,setter
+ ,car-symbol))))