fork download
  1. (defclass b () ())
  2. (defmethod m1 ((_ b)) "m1")
  3. (defclass c (b) ())
  4. (setf obj (make-instance 'c))
  5. (format t "~A~%" (m1 obj)) ;;=> m1
  6.  
  7. (defclass a () ())
  8. (defclass b (a) ())
  9. (defmethod m2 ((_ a)) "m2")
  10. (format t "~A~%" (m1 obj)) ;;=> m1
  11. (format t "~A~%" (m2 obj)) ;;=> m2
Success #stdin #stdout #stderr 0.05s 10976KB
stdin
Standard input is empty
stdout
m1
m1
m2
stderr
WARNING: DEFCLASS: Class C (or one of its ancestors) is being redefined, instances are obsolete