shiro #1482(2007/07/26 18:38 GMT) [ Scheme ] Rating2/2=1.00
GaucheではCommonLispと同様に、メソッドはクラスでなく総称関数に所属します。 ここではモジュールの中から探してみることにします。 使い方の例: (define-module foo (define (test_1) (print 1)) (define (test_2) (print 2)) (define test_3 "I'm variable!") (define (test_4) (print 4))) (call-tests (find-module 'foo))
1 2 3 4 5 6 7
(define (call-tests module) (hash-table-for-each (module-table module) (lambda (k v) (and-let* ([ (#/^test_/ (x->string k)) ] [val (global-variable-ref module k)] [ (procedure? val) ]) (val)))))
Rating2/2=1.00-0+
[ reply ]
shiro
#1482()
[
Scheme
]
Rating2/2=1.00
Rating2/2=1.00-0+
[ reply ]