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

A generic function can have more than one name, via

	(SETF FDEFINITION), and it's possible to define methods with both
	names.  Method functions are named with the name specified in
	DEFMETHODS.  Methods metaobjects are unnamed.  Taking this all
	together means that we must always use METHOD-FUNCTION-GET :NAME
	to find out the name of a method function if we want to use it.

	This showed up in gray-streams.lisp.  Found by Paul Werkowski.

	* src/pcl/boot.lisp (method-function-name): Moved here from
	combin.lisp; use method-function-get :name.

	* src/pcl/combin.lisp (method-function-name): Move to boot.lisp.
parent f5bd64e8
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@
;;; *************************************************************************
(file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/boot.lisp,v 1.62 2003/05/28 10:41:47 gerd Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/boot.lisp,v 1.63 2003/05/30 09:14:34 gerd Exp $")
(in-package :pcl)
......@@ -1139,7 +1139,6 @@ work during bootstrapping.
(val method-function key)
(setf (getf (method-function-plist method-function) key) val))
(defun method-function-pv-table (method-function)
(method-function-get method-function :pv-table))
......@@ -1149,6 +1148,16 @@ work during bootstrapping.
(defun method-function-needs-next-methods-p (method-function)
(method-function-get method-function :needs-next-methods-p t))
;;;
;;; Return a method function name of METHOD. If FAST-FUNCTION
;;; is true, return the fast method function name, otherwise
;;; return the slow method function name.
;;;
(defun method-function-name (method &optional (fast-function t))
(let ((fn (slot-value method
(if fast-function 'fast-function 'function))))
(assert (functionp fn))
(method-function-get fn :name)))
(defun load-defmethod (class name quals specls ll initargs
......
......@@ -25,7 +25,7 @@
;;; *************************************************************************
(file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/combin.lisp,v 1.17 2003/05/28 10:41:47 gerd Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/combin.lisp,v 1.18 2003/05/30 09:14:34 gerd Exp $")
(in-package "PCL")
......@@ -466,17 +466,6 @@
,@check-applicable-keywords
,body))))))
;;;
;;; Return a method function name of METHOD. If FAST-FUNCTION
;;; is true, return the fast method function name, otherwise
;;; return the slow method function name.
;;;
(defun method-function-name (method &optional (fast-function t))
(let ((name (nth-value 2 (parse-method-or-spec method))))
(if fast-function
(cons 'fast-method (cdr name))
name)))
;;;
;;; Return a form for calling METHOD's fast function. METATYPES is a
;;; list of metatypes, whose length is used to figure out the names of
......@@ -500,11 +489,11 @@
;;; variable containing a list of FAST-METHOD-CALL structures
;;; corresponding to the method function calls.
;;;
(defun make-direct-calls (methods metatypes apply? list-var)
(defun make-direct-calls (methods metatypes rest? list-var)
(collect ((calls))
(dolist (method methods)
(calls `(let ((.call. (pop .list.)))
,(make-direct-call method metatypes apply? '.call.))))
,(make-direct-call method metatypes rest? '.call.))))
`(let ((.list. ,list-var))
(declare (ignorable .list.))
,@(calls))))
......
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