defsetf: bad expansion with custom keyword names
Expansion of DEFSETF when keyword argument has a name not in the keyword package doesn't work. If we replace
((a a)) with simply
a, and call it with
:a instead of
'a things work as expected.
CL-USER> (defsetf abc (place &key ((a a))) (arg) `(setf (car ,place) (+ ,a ,arg))) ABC CL-USER> (setf (abc (cons nil nil) 'a 1) 2) ; Evaluation aborted on #<a SI:SIMPLE-PROGRAM-ERROR 0x55ef3e2ed9c0>. In form (SETF (ABC (CONS NIL NIL) 'A 1) 2) Unknown keyword argument passed to function #<bytecompiled-function 0x55ef3db85f00>. Argument list: (#:G129 #:G127 #:G128 1) [Condition of type SI:SIMPLE-PROGRAM-ERROR]
The expected result is 3. defsetf lambda list explicitly allows custom keyword argument names. The same problem occurs on SBCL (or a problem with a very similar symptoms). On CCL everything works as expected (it is worth looking at their expansion, they go with a function to which arguments are applied).