ccl icon indicating copy to clipboard operation
ccl copied to clipboard

fix interpretation of defsetf lambda lists

Open enometh opened this issue 5 years ago • 0 comments
trafficstars

  • lib/setf.lisp: (defsetf) use CCL::%DESTRUCTURE-LAMBDA-LIST instead of CCL::RENAME-LAMBDA-VARS to come up with a suitable setf expansion.

https://lists.clozure.com/pipermail/openmcl-devel/2020-September/012217.html

Currently CCL does not expand defsetf lambda lists of the form (defsetf get-foo (&key (add1 1) (add2 (+ add1 2))) (data) `(setq $foo (- ,data ,add1 ,add2))) (get-setf-expansion '(get-foo)) ;; => The value #:ADD1 is not of the expected type NUMBER.

WIP. This patch tries to rectify that. With this patch

(setf (get-foo) 10) ;; should return 6

The patch is for review and doesn't fix indentation and involved the use of of an unhygenic EXPRESSION symbol. This is to facilitate easy review.

enometh avatar Sep 27 '20 01:09 enometh