Add a function to list procs and their docs in a module
This commit is contained in:
parent
fced876ec5
commit
383d97b046
|
@ -0,0 +1,14 @@
|
|||
|
||||
;; Example of how to fetch docs from a module.
|
||||
;; This sort of pattern can be used when we want to scan a given module.
|
||||
(define (pp-module-docs module)
|
||||
(module-for-each
|
||||
(lambda (sym var)
|
||||
(let* ((binding (variable-ref var))
|
||||
(proc (cond
|
||||
((procedure? binding) binding)
|
||||
((macro? binding) (macro-binding binding))
|
||||
(else "???")))
|
||||
(docs (procedure-documentation proc)))
|
||||
(format #t "-- ~y ~a\n" sym docs)))
|
||||
(resolve-interface module)))
|
Loading…
Reference in New Issue