Debian Codegraph @

test/list-procedure-types.scm

raw
1 ;;
2 ;; List types of all procedures in Gauche
3 ;;
4
5 (define (show module-name)
6 (let1 m (find-module module-name)
7 (dolist [n (hash-table-keys (module-table m))]
8 (let1 v (module-binding-ref m n #f)
9 (when (procedure? v)
10 ;; we flush the name first, so that we can detect which one got
11 ;; the problem.
12 (format #t "~20s " n)
13 (flush)
14 (format #t "~s\n" (procedure-type v)))))))
15
16 (define *modules*
17 '(scheme gauche))
18
19 (define (main args)
20 (if (null? (cdr args))
21 (for-each show *modules*)
22 (for-each show (map string->symbol (cdr args))))
23 0)