I've bumped into an DEFSETF's example in CL HyperSpec
This works
(defvar *xy* (make-array '(10 10)))
(defun xy (&key (x 0) (y 0))
(aref *xy* x y))
(defun set-xy (new-value &key (x 0) (y 0))
(setf (aref *xy* x y) new-value))
(defsetf xy (&key (x 0) (y 0)) (store)
`(set-xy ,store :x ,x :y ,y))
(get-setf-expansion '(xy :x a :y b))
but the original example itself doesn't
(defun xy (&key ((x x) 0) ((y y) 0))
(aref *xy* x y))
(defun set-xy (new-value &key ((x x) 0) ((y y) 0))
(setf (aref *xy* x y) new-value))
(defsetf xy (&key ((x x) 0) ((y y) 0)) (store)
`(set-xy ,store 'x ,x 'y ,y))
In the original example I see
(get-setf-expansion '(xy a b))
This makes little sense to me and it doesn't work
Error: keyword list (#:g6561 #:g6562) should only contain keys (y x)
I tried
(get-setf-expansion '(xy x a y b))
and
(get-setf-expansion '(xy 'x a 'y b))
both doesn't work with the similar error.
Would you throw some light on this ?
--
Vladimir Zolotykh