From e13a9dcbc4cb405f7e87a7adee87dcf36ca41557 Mon Sep 17 00:00:00 2001
From: gerd <gerd>
Date: Fri, 30 May 2003 09:14:34 +0000
Subject: [PATCH] 	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.
---
 pcl/boot.lisp   | 13 +++++++++++--
 pcl/combin.lisp | 17 +++--------------
 2 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/pcl/boot.lisp b/pcl/boot.lisp
index 1f1e872fb..65927d8e9 100644
--- a/pcl/boot.lisp
+++ b/pcl/boot.lisp
@@ -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
diff --git a/pcl/combin.lisp b/pcl/combin.lisp
index 5a12fbd3b..e6ae26529 100644
--- a/pcl/combin.lisp
+++ b/pcl/combin.lisp
@@ -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))))
-- 
GitLab