Hi,

Shenli Zhu <zhushen...@gmail.com> writes:

> Everyone knows a good debugger is very important,

I’m not sure if you’ve seen that, but while Guile 1.9 doesn’t have
breakpoints yet, it does have debugging capabilities.  For instance,
here’s an interactive session showing the debugging REPL in 1.9.12:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (define (foo x) (/ 2 x))
scheme@(guile-user)> (foo 0)
<unnamed port>:8:17: In procedure /:
<unnamed port>:8:17: Numerical overflow
Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ,bt
In current input:
     7:16  0 (foo 0)
scheme@(guile-user) [1]> ,proc
$1 = #<procedure foo (x)>
scheme@(guile-user) [1]> ,locals
  Local variables:
  $2 = x = 0
scheme@(guile-user) [1]> ,error
<unnamed port>:8:17: In procedure /:
<unnamed port>:8:17: Numerical overflow
--8<---------------cut here---------------end--------------->8---

There are other facilities, like procedure call tracing:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (define (fib n) (if (<= n 1) n (+ (fib (- n 1)) (fib (- n 
2)))))
scheme@(guile-user)> ,trace (fib 3)
(fib 3)
|(fib 2)
||(fib 1)
||1
||(fib 0)
||0
|1
|(fib 1)
|1
2
--8<---------------cut here---------------end--------------->8---

Just to illustrate that while debugging support in 1.9 isn’t perfect,
it’s not completely lacking either.  :-)

Thanks,
Ludo’.


Reply via email to