comparison lisp/cl-macs.el @ 5889:bd644055ef44

Correct a bug in #'check-type, non-setf'able PLACEs lisp/ChangeLog addition: 2015-04-11 Aidan Kehoe <kehoea@parhasard.net> * cl-macs.el: * cl-macs.el (check-type): Correct the sense of the type test here when PLACE is not setf'able, something which gave confusing errors with literal fixnums or, e.g., (+ 30 40). tests/ChangeLog addition: 2015-04-11 Aidan Kehoe <kehoea@parhasard.net> * automated/lisp-tests.el: Check for a bug just fixed in cl-macs.el.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 11 Apr 2015 18:06:17 +0100
parents 4004c3266c09
children ffb5abc8dc4e
comparison
equal deleted inserted replaced
5888:a85efdabe237 5889:bd644055ef44
3032 temp (list 'quote place)))) 3032 temp (list 'quote place))))
3033 (body 3033 (body
3034 (condition-case nil 3034 (condition-case nil
3035 `(while (not ,test) 3035 `(while (not ,test)
3036 ,(macroexpand `(setf ,place ,signal-error))) 3036 ,(macroexpand `(setf ,place ,signal-error)))
3037 ;; Common Lisp requires that PLACE be setfable, but this is
3038 ;; never a restriction that this package has enforced.
3037 (error 3039 (error
3038 `(if ,test (progn ,signal-error nil)))))) 3040 `(if (not ,test) (progn ,signal-error nil))))))
3039 (if (eq temp place) `(progn ,body nil) 3041 (if (eq temp place) `(progn ,body nil)
3040 `(let ((,temp ,place)) ,body nil))))) 3042 `(let ((,temp ,place)) ,body nil)))))
3041 3043
3042 ;;;###autoload 3044 ;;;###autoload
3043 (defmacro assert (form &optional show-args string &rest args) 3045 (defmacro assert (form &optional show-args string &rest args)