This comment is reply for 1246 shiro: Schemeの場合、そもそも関数という概...(呼んだのは誰?). Go to thread root.
shiro #1247(2007/07/21 06:34 GMT) [ Scheme ] Rating1/1=1.00
ちなみに下のマクロも仕込んでおけば見かけ上は普通の手続き定義のようになります: gosh> (define (bar) (foo)) #<<tracer> 0x8cc0900> gosh> (define (baz) (foo)) #<<tracer> 0x8cc0880> gosh> (bar) bar gosh> (baz) baz ただ、マクロを使ったら何でもありになってしまいますね。 (マクロ内で手続きのトレース用のラッパーを仕込んでしまう、とか。)
1 2 3 4 5 6 7 8 9
(use util.match) (define-macro (define . args) (match args [((fn . args) . body) `(begin ((with-module gauche define) ,fn (make <tracer> :name ',fn)) (define-method ,fn ,args . ,body))] [(var expr) `((with-module gauche define) ,var ,expr)]))
Rating1/1=1.00-0+
[ reply ]
shiro
#1247()
[
Scheme
]
Rating1/1=1.00
Rating1/1=1.00-0+