Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lisp code debugging

During web searching, I found the following comment : Traditional Lisp debugging practices can still be used.

  • What are the traditional debugging practices?
  • Normally, what tools are used for debugging lisp (with/without emacs)?
like image 444
prosseek Avatar asked Jul 15 '10 16:07

prosseek


People also ask

How do I debug AutoLISP?

By pausing the AutoLISP interpreter, we can take control of the flow of evaluation, starting & stopping the code when and where we like. To do this, in the VLIDE Editor window, place your cursor in front of the opening bracket of the while expression, click, and go to Debug » Toggle Break Point (F9).

How do I run a LISP code in Visual Studio?

Inside of VSCode, open a lisp file that you want to edit. Inside of VSCode, open the Command Palette on the menu at the top where it says View/Command Palette and start an instance of SBCL running a Swank server attached to your VSCode REPL by choosing: Alive: Start REPL And Attach .

How do I debug in Emacs?

You can enter the debugger when you call the function by calling debug-on-entry . Now, type d again, eight times, slowly. Each time you type d , Emacs will evaluate another expression in the function definition. By typing d , you were able to step through the function.

What is Vlide?

The Visual LISP IDE (rather, more precisely: Visual LISP Integrated Development Environment (VLIDE) - but that's a bit of a mouthful), is an excellent developer tool & resource supplied as standard with the majority of full versions of AutoCAD.


2 Answers

I don't know what Bill meant specifically, but IME:

Typically your editor will have a running instance connected to it. You can compile functions immediately to insert them into the running image -- since Lisp has its own compiler, you're just telling the running image to read and compile a small section of text. Or you can run functions directly, to see what they do.

When an exception is thrown (or a condition is signaled, if you're lucky enough to be in a dialect with conditions), the debugger will show you the stack trace and let you decide how to continue.

The major difference between Lisp and other high-level compiled languages is that in Lisp you're basically always writing code with the debugger attached.

like image 153
Ken Avatar answered Sep 19 '22 12:09

Ken


As clojure was tagged in the question, I'll give our perspective.

Class files generated by the clojure compiler include line- and method-based debugging info, so any java debugger will interoperate directly with clojure code, including breakpoints and object inspection.

If you use emacs/slime as your development environment, integration with slime's debugger has recently been included. As documentation is a little sparse, it's probably best to check out the scope of the support on github directly.

like image 40
Mike Douglas Avatar answered Sep 19 '22 12:09

Mike Douglas