Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial debugger support #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shawwn
Copy link
Member

@shawwn shawwn commented Feb 6, 2019

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

@rocketnia
Copy link
Member

Awesome. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants