anarki
anarki copied to clipboard
Initial debugger support
This PR might need to be cleaned up before merging, but you can play around with it in the meantime.
Basically, you can write (dbg)
anywhere in your Arc code and it'll drop you into a debugger.
If you write (dbg some-expression)
then the debugger has some extra support for seeing the value of that expression.
arc> (def adder (x) (fn (n) (dbg (+ x n))))
arc> (= add1 (adder 1))
arc> (add1 42)
locals:
*name "adder-"
n 42
x 1
type 'h to see this printout
type 'c to continue
type 'v to see value of '(+ x n)
> 'v
43
> (= x 99)
99
> 'v
141
> 'c
'(+ x n)
returned 141
141
arc> (add1 1)
locals:
*name "adder-"
n 1
x 99
type 'h to see this printout
type 'c to continue
type 'v to see value of '(+ x n)
> 'v
100
> 'c
'(+ x n)
returned 100
100
Awesome. :)