Skip to content
Snippets Groups Projects
Commit b92dd386 authored by ram's avatar ram
Browse files

Removed "encapsulation" of DESCRIBE, since our describe now calls

DESCRIBE-OBJECT.
Added a DESCRIBE-OBJECT method for STANDARD-GENERIC-FUNCTION which
prints out the methods.
parent 7f3f5b2c
No related branches found
No related tags found
No related merge requests found
...@@ -100,8 +100,10 @@ ...@@ -100,8 +100,10 @@
(defgeneric describe-object (object stream)) (defgeneric describe-object (object stream))
#-cmu
(defvar *old-describe* ()) (defvar *old-describe* ())
#-cmu
(eval-when (load) (eval-when (load)
(unless *old-describe* (setq *old-describe* (symbol-function 'describe))) (unless *old-describe* (setq *old-describe* (symbol-function 'describe)))
(setf (symbol-function 'describe) (setf (symbol-function 'describe)
...@@ -117,8 +119,11 @@ ...@@ -117,8 +119,11 @@
(values)))) (values))))
(defmethod describe-object (object stream) (defmethod describe-object (object stream)
#-cmu
(let ((*standard-output* stream)) (let ((*standard-output* stream))
(funcall *old-describe* object))) (funcall *old-describe* object))
#+cmu
(describe object stream))
(defmethod describe-object ((object standard-object) stream) (defmethod describe-object ((object standard-object) stream)
(let* ((class (class-of object)) (let* ((class (class-of object))
...@@ -169,6 +174,19 @@ ...@@ -169,6 +174,19 @@
(slotd-allocation slotd)))) (slotd-allocation slotd))))
(values)))) (values))))
#+cmu
(defmethod describe-object ((fun standard-generic-function) stream)
(format stream "~A is a generic function.~%" fun)
(format stream "Its arguments are:~% ~S~%"
(generic-function-pretty-arglist fun))
(format stream "Its methods are:")
(dolist (meth (generic-function-methods fun))
(format stream "~2%**** ~{~S ~}~:S =>~%"
(method-qualifiers meth)
(unparse-specializers meth))
(describe-object (method-function meth) stream)))
(defmethod slots-to-inspect ((class std-class) (object standard-object)) (defmethod slots-to-inspect ((class std-class) (object standard-object))
(class-slots class)) (class-slots class))
......
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