X-Git-Url: https://git.hcoop.net/bpt/guile.git/blobdiff_plain/78591ef5c3c4dd44cac912704696cf77c2cbbf73..8f5cfc810fb19fdfbeaa55d59d47dc5ab50c416b:/module/system/repl/describe.scm diff --git a/module/system/repl/describe.scm b/module/system/repl/describe.scm index 966ea7d46..15f0b0b04 100644 --- a/module/system/repl/describe.scm +++ b/module/system/repl/describe.scm @@ -22,16 +22,15 @@ (define-module (system repl describe) :use-module (oop goops) :use-module (ice-9 regex) - :use-module (ice-9 format)) + :use-module (ice-9 format) + :use-module (ice-9 and-let-star) + :export (describe)) -(define *describe-format* #t) - -(define-public (describe symbol) - (assert symbol? symbol) +(define-method (describe (symbol )) (format #t "`~s' is " symbol) (if (not (defined? symbol)) (display "not defined in the current module.\n") - (describe-object (eval symbol)))) + (describe-object (module-ref (current-module) symbol)))) ;;; @@ -302,13 +301,13 @@ ;;; Instances ;;; -(define-method display-type ((obj )) +(define-method (display-type (obj )) (display-class "an instance") (display " of class ") (display-class (class-of obj)) (display ".\n")) -(define-method display-value ((obj )) +(define-method (display-value (obj )) (display-slot-list #f obj (class-slots (class-of obj)))) @@ -316,13 +315,13 @@ ;;; Generic functions ;;; -(define-method display-type ((obj )) +(define-method (display-type (obj )) (display-class "a generic function") (display " of class ") (display-class (class-of obj)) (display ".\n")) -(define-method display-value ((obj )) +(define-method (display-value (obj )) (display-list #f (generic-function-methods obj)))