mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-03-12 07:50:26 -07:00
Better printing of method objects.
Print method qualifiers.
For specializers, print class names, not class objects, and print eql specializers.
(defmethod m :around (a b (c (eql "10"))))
was
#<standard-method M (#<BUILT-IN-CLASS T> #<BUILT-IN-CLASS T>
#<CLOS:EQL-SPECIALIZER>)>
becomes
#<standard-method M :AROUND (T T (EQL "10"))>
This commit is contained in:
parent
815f6f07ae
commit
5f0beddf69
1 changed files with 12 additions and 6 deletions
|
|
@ -199,12 +199,18 @@ printer and we should rather use MAKE-LOAD-FORM."
|
|||
|
||||
(defmethod print-object ((m standard-method) stream)
|
||||
(print-unreadable-object (m stream :type t)
|
||||
(format stream "~A ~A"
|
||||
(let ((gf (method-generic-function m)))
|
||||
(if gf
|
||||
(generic-function-name gf)
|
||||
'UNNAMED))
|
||||
(method-specializers m)))
|
||||
(format stream "~A ~{~S ~}~S"
|
||||
(let ((gf (method-generic-function m)))
|
||||
(if gf
|
||||
(generic-function-name gf)
|
||||
'UNNAMED))
|
||||
(method-qualifiers m)
|
||||
(loop for spec in (method-specializers m)
|
||||
collect (cond ((and (classp spec)
|
||||
(class-name spec)))
|
||||
((typep spec 'eql-specializer)
|
||||
`(eql ,(eql-specializer-object spec)))
|
||||
(t spec)))))
|
||||
m)
|
||||
|
||||
(defun ext::float-nan-string (x)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue