Skip to content
Snippets Groups Projects
Forked from cmucl / cmucl
Source project has a limited visibility.
  • gerd's avatar
    606c6835
    CLHS 7.6.5 keyword argument checking for calls to generic · 606c6835
    gerd authored
    	functions.  Found by Paul Dietz, of course.  This also includes
    	some minor code cleanup and a fix for a bug caused by a typo.
    
    	* src-gf/pcl/std-class.lisp
    	(compute-effective-slot-definition-initargs):
    	Reformatted to make it readable on a tty.
    
    	* src-gf/pcl/methods.lisp (set-condition-svuc-method): Fix a typo.
    
    	* src-gf/pcl/low.lisp (parse-lambda-list): Add an ignore
    	declaration.
    
    	* src-gf/pcl/init.lisp (valid-initargs): Use method-lambda-list*.
    
    	* src-gf/pcl/dfun.lisp (use-caching-dfun-p): Use
    	generic-function-methods*.
    	(use-constant-value-dfun-p): Ditto.
    	(use-dispatch-dfun-p): Don't use dispatching dfuns when we must
    	check keyword arguments according to CLHS 7.6.5, because this
    	computes emfs for sets methods that aren't applicable together in
    	the usual sense; this screws up emf keyword argument checking, of
    	course.
    	(make-initial-dfun): Use gf-arg-info*.
    	(update-dfun): Use generic-function-name*.
    	(final-accessor-dfun-type, make-accessor-table)
    	(compute-applicable-methods-using-types)
    	(compute-applicable-methods-using-types): Likewise.
    
    	* src-gf/pcl/combin.lisp (standard-compute-effective-method):
    	Don't use the single-call-method optimization if we must
    	check keyword arguments according to CLHS 7.6.5.
    	(callable-generator-for-emf): Rewritten to add a keyword
    	argument check to the emf.
    	(emfs-must-check-applicable-keywords-p)
    	(compute-applicable-keywords, check-applicable-keywords):
    	New functions.
    	(odd-number-of-keyword-arguments, invalid-keyword-argument):
    	Moved here from boot.lisp.
    	(make-effective-method-lambda): Add a check-applicable-keywords
    	form to the emf, if appropriate.
    	(memf-test-converter, memf-code-converter)
    	(memf-constant-converter): Deal with check-applicable-keywords.
    	(*applicable-methods*): New variable.
    	(make-callable): Bind it.
    	(make-emf-name): Use generic-function-name*.
    
    	* src/pcl/braid.lisp (ensure-non-standard-class): Remove
    	an used branch.
    
    	* src/pcl/boot.lisp (*make-method-lambda-gf-name*): Removed.
    	(expand-defmethod): Don't bind it.
    	(make-method-lambda-internal): Don't add &key to the method
    	function's lambda-list if the gf has &key.
    	(bind-args): Rewritten.  Don't do keyword checking as this is
    	done in emfs now.
    	(get-key-arg, get-key-arg1): Simplified; do less checking.
    	(generic-function-name*, generic-function-methods*)
    	(gf-arg-info*, method-lambda-list*): New functions.
    	(check-method-arg-info): Use them.
    	(gf-lambda-list-from-method): New function.
    	(gf-lambda-list): Use it.  Don't add &allow-other-keys to a
    	gf's lambda-list if a method has &key.
    	(get-generic-function-info): Use gf-arg-info*.
    	(parse-specialized-lambda-list): Add an ignore declaration.
    	(odd-number-of-keyword-arguments, invalid-keyword-argument):
    	Moved to combin.lisp.
    	(check-generic-function-lambda-list): Remove &more stuff
    	because that's checked elsewhere now (and Python can even
    	tell it is).
    
    	* src-gf/pcl/ctor.lisp (install-optimized-constructor): Remove
    	an unmatched ).
    606c6835
    History
    CLHS 7.6.5 keyword argument checking for calls to generic
    gerd authored
    	functions.  Found by Paul Dietz, of course.  This also includes
    	some minor code cleanup and a fix for a bug caused by a typo.
    
    	* src-gf/pcl/std-class.lisp
    	(compute-effective-slot-definition-initargs):
    	Reformatted to make it readable on a tty.
    
    	* src-gf/pcl/methods.lisp (set-condition-svuc-method): Fix a typo.
    
    	* src-gf/pcl/low.lisp (parse-lambda-list): Add an ignore
    	declaration.
    
    	* src-gf/pcl/init.lisp (valid-initargs): Use method-lambda-list*.
    
    	* src-gf/pcl/dfun.lisp (use-caching-dfun-p): Use
    	generic-function-methods*.
    	(use-constant-value-dfun-p): Ditto.
    	(use-dispatch-dfun-p): Don't use dispatching dfuns when we must
    	check keyword arguments according to CLHS 7.6.5, because this
    	computes emfs for sets methods that aren't applicable together in
    	the usual sense; this screws up emf keyword argument checking, of
    	course.
    	(make-initial-dfun): Use gf-arg-info*.
    	(update-dfun): Use generic-function-name*.
    	(final-accessor-dfun-type, make-accessor-table)
    	(compute-applicable-methods-using-types)
    	(compute-applicable-methods-using-types): Likewise.
    
    	* src-gf/pcl/combin.lisp (standard-compute-effective-method):
    	Don't use the single-call-method optimization if we must
    	check keyword arguments according to CLHS 7.6.5.
    	(callable-generator-for-emf): Rewritten to add a keyword
    	argument check to the emf.
    	(emfs-must-check-applicable-keywords-p)
    	(compute-applicable-keywords, check-applicable-keywords):
    	New functions.
    	(odd-number-of-keyword-arguments, invalid-keyword-argument):
    	Moved here from boot.lisp.
    	(make-effective-method-lambda): Add a check-applicable-keywords
    	form to the emf, if appropriate.
    	(memf-test-converter, memf-code-converter)
    	(memf-constant-converter): Deal with check-applicable-keywords.
    	(*applicable-methods*): New variable.
    	(make-callable): Bind it.
    	(make-emf-name): Use generic-function-name*.
    
    	* src/pcl/braid.lisp (ensure-non-standard-class): Remove
    	an used branch.
    
    	* src/pcl/boot.lisp (*make-method-lambda-gf-name*): Removed.
    	(expand-defmethod): Don't bind it.
    	(make-method-lambda-internal): Don't add &key to the method
    	function's lambda-list if the gf has &key.
    	(bind-args): Rewritten.  Don't do keyword checking as this is
    	done in emfs now.
    	(get-key-arg, get-key-arg1): Simplified; do less checking.
    	(generic-function-name*, generic-function-methods*)
    	(gf-arg-info*, method-lambda-list*): New functions.
    	(check-method-arg-info): Use them.
    	(gf-lambda-list-from-method): New function.
    	(gf-lambda-list): Use it.  Don't add &allow-other-keys to a
    	gf's lambda-list if a method has &key.
    	(get-generic-function-info): Use gf-arg-info*.
    	(parse-specialized-lambda-list): Add an ignore declaration.
    	(odd-number-of-keyword-arguments, invalid-keyword-argument):
    	Moved to combin.lisp.
    	(check-generic-function-lambda-list): Remove &more stuff
    	because that's checked elsewhere now (and Python can even
    	tell it is).
    
    	* src-gf/pcl/ctor.lisp (install-optimized-constructor): Remove
    	an unmatched ).