Jim Ursetto  committed b03708b Draft

add CPL and slots to standard-class description

  • Participants
  • Parent commits 4a07405
  • Branches default

Comments (0)

Files changed (1)

File describe-coops-mod.scm

 (use coops)
 (use (only srfi-13 string-pad))
+;;(use (prefix describe describe:))
 (define-inline (symbol-length sym) (string-length (symbol->string sym)))
 (define-inline (*class-slots class) (slot-value class 'slots))
       (fprintf out "coops instance of primitive class `<procedure>'~%") ) )
 (define-method (describe-object (class <standard-class>) #!optional (out (current-output-port)))
-  (fprintf out "coops standard-class `~A'~%" (class-name class)) )
+  (fprintf out "coops standard-class ~A~%" (class-name class))
+  (fprintf out "  class precedence list: ~S~%"
+           (map class-name (slot-value class 'class-precedence-list)))
+  (fprintf out "  slots: ~S~%"
+           (slot-value class 'slots)))
+;; Note: initforms are buried in initthunks; introspecting their values by thunking may
+;; be dangerous if the forms have side-effects.
+;; (map (lambda (x) (cons (car x) ((cdr x)))) (slot-value class 'initthunks))
+(define-class <human> () ((name "Anne O. Nymous")
+                          favorite-drink))