Detect odd-length keyword argument lists, invalid keyword
arguments is methods. Change lambda-lists of some gfs and methods to include &key, or &key &allow-other-keys. Bugs found by Paul Dietz in his test suite. * src/pcl/boot.lisp (bind-args): Handle the case that &key is in the lambda-list, but no keyword args. (get-key-arg1): Additional argument first-time; check for invalid keyword arguments, and add number of args when true. (get-key-arg): Call get-key-arg1. (odd-number-of-keyword-arguments, invalid-keyword-argument): New functions. * src/pcl/init.lisp (make-instance) <symbol, class>: Add &key. (initialize-instance) <slot-object>: Likewise. (reinitialize-instance) <slot-object>: Likewise. (update-instance-for-different-class): Likewise. (update-instance-for-redefined-class): Likewise. (shared-initialize) <slot-object>: Likewise. * src/pcl/std-class.lisp (change-class): Likewise. * src/pcl/slots.lisp (allocate-instance) <standard-class>: (allocate-instance) <structure-class>: Likewise. * src/pcl/methods.lisp (reinitialize-instance) <standard-method>: Likewise. * src/pcl/generic-functions.lisp (change-class) (allocate-instance, update-instance-for-different-class) (update-instance-for-redefined-class): Add &key &allow-other-keys. * src/pcl/fsc.lisp (allocate-instance) <funcallable-standard-class>: Add &key. * src/pcl/std-class.lisp (make-defstruct-allocation-function): Fix a paren bug.
Showing
- pcl/boot.lisp 78 additions, 60 deletionspcl/boot.lisp
- pcl/fsc.lisp 3 additions, 3 deletionspcl/fsc.lisp
- pcl/generic-functions.lisp 9 additions, 5 deletionspcl/generic-functions.lisp
- pcl/init.lisp 9 additions, 8 deletionspcl/init.lisp
- pcl/methods.lisp 2 additions, 2 deletionspcl/methods.lisp
- pcl/slots.lisp 3 additions, 3 deletionspcl/slots.lisp
- pcl/std-class.lisp 10 additions, 10 deletionspcl/std-class.lisp
Loading
Please register or sign in to comment