Skip to content
Snippets Groups Projects
Commit 6d42033b authored by gerd's avatar gerd
Browse files

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.
parent 82e48377
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment