| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Gauche doesn't have much support for debugging yet. The idea of good debugging interfaces are welcome.
For now, the author uses the classic 'debug print stub' technique
when necessary. A special reader syntax #?=expr is
defined, which is read as (debug-print expr).
The macro debug-print evaluates and returns the result(s),
printing messages before and after evaluation of expr.
gosh> #?=(+ 2 3)
#?="(stdin)":1:(+ 2 3)
#?- 5
5
gosh> #?=(begin (print "foo") (values 'a 'b 'c))
#?="(stdin)":2:(begin (print "foo") (values 'a 'b 'c))
foo
#?- a
#?+ b
#?+ c
a
b
c
gosh> (define (fact n)
(if (zero? n)
1
(* n #?=(fact (- n 1)))))
fact
gosh> (fact 5)
#?="(stdin)":6:(fact (- n 1))
#?="(stdin)":6:(fact (- n 1))
#?="(stdin)":6:(fact (- n 1))
#?="(stdin)":6:(fact (- n 1))
#?="(stdin)":6:(fact (- n 1))
#?- 1
#?- 1
#?- 2
#?- 6
#?- 24
120
|
You can also use trace/untrace macros in Gauche, written by Shigenobu Kimura: http://homepage.mac.com/skimu/ggc/.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by Shiro Kawai on October, 7 2008 using texi2html 1.78.