nobody-famous / alive

Common Lisp Extension for VSCode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a document to show how to debug common lisp codes using this extension?

yanpeng opened this issue · comments

I am quite new to common lisp. I am confused about how to debug cl codes using this extension. Can you give me some tips? thanks.

There's no document, unfortunately. Debugging CL is usually done through the REPL.

You can send forms to evaluate using the Send To REPL command, which is bound to Alt+Shift+Enter by default. The output goes to the REPL window. If you open a scratch buffer (there's now an Open Scratch Pad command), you can enter things in there to send. There's also an Inline Eval command, bound to Alt+Shift+E by default, that evaluates a form and displays the result inline instead of sending it to the REPL window.

It can make things easier to have the scratch buffer be in the same package as whatever code you're working on. If you put an in-package form at the top of the file, it'll have access to everything in that package.

If there's something you want to evaluate over and over, you can enter it in the REPL input box and it'll be added to the REPL history. You can rerun it from there using the REPL History command, which is bound to Alt+Shift+R by default. It behaves like the VSCode tasks, so the last one used gets moved to the top of the list.

Hope that helps!

Thanks for your help. Before I knew alive extension, I used emacs + sly for several days. What I often used method for debugging is

  1. put (proclaim '(optimize (debug 3))) in .sbclrc
  2. put (break) in some place of my cl codes.
  3. compile and load file.
  4. type the function containing the breakpoint in REPL
  5. then the program stop at the breakpoint, so I can step into or step over the following codes, eval in frame.

I tried to use the same method in alive, but it seems that it cannot support (break) ?

Maybe my question is naive, I don't know much lisp now. sorry for that.

Ah, gotcha. Yeah, that's not there, yet. Per the spec, the condition that break uses cannot be handled in code. It goes directly to the built in debugger. I did a couple things to try to get around that and none of them worked. It'll take some more looking into, so I put it on the back burner for now.