Comment detail
呼んだのは誰? (Nested Flatten)ちなみに下のマクロも仕込んでおけば見かけ上は普通の手続き定義のようになります: 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)]))
|





shiro
#1246()
[
Scheme
]
Rating1/1=1.00
Rating1/1=1.00-0+
1 reply [ reply ]