[Openmcl-devel] PATCH fix defsetf lambda-lists

Madhu enometh at meer.net
Sat Sep 26 07:11:36 PDT 2020


Hello.  There is a problem with CCL's interpretation of defsetf
lambda-lists (3.4.7). The following example blows.

(defvar $foo 10)
(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.
(setf (get-foo) 10) ;; should return 6

Attached is a hacked up patch which attempts to fix this. It uses
CCL::%DESTRUCTURE-LAMBDA-LIST instead of CCL::RENAME-LAMBDA-VARS to
come up with a suitable setf expansion. There is one remaining
"unhygenic" use of EXPRESSION in the code, and I haven't fixed the
indentation - this is so that the changes I've made are clearly
visible for inspection.

I'd appreciate it if you could test and review this patch for
correctness, and commit something like it---Madhu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-ccl-defsetf.patch
Type: text/x-patch
Size: 2924 bytes
Desc: not available
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20200926/1c4930f2/attachment.bin>


More information about the Openmcl-devel mailing list