Hacker News new | past | comments | ask | show | jobs | submit login
Debugging Lisp, Part 5 (malisper.me)
131 points by jorams on Aug 20, 2015 | hide | past | favorite | 10 comments



Thank you for writing these. I've found that a lot of the lisp materials out there are either completely introductory (lambda/map/reduce/filter) or seem like the artifacts of an alien civilization far beyond my comprehension. I've been following malisper for a little while and it's consistently quality material that's roughly at my level.


Agreed. What is it about lisp that creates blogs of these two types? Emacs is the same. Loads of articles on how to do simple stuff, a few on very low-level and nothing in-between.

I think other languages also have this pattern but in the lisp family it seems more stark.


trace is the thing I miss most when I'm not using Common Lisp.


I too miss trace a lot. Whenever I have worked on a common lisp project, trace has helped a ton to understand the application design, either for a new feature addition or a bug fix. Just knowing the starting function and tracing the package that it belongs to gets me going.

And using the Output Data View if I am using LW IDE is even more fun. [1]

trace also I think serves as a nice documentation if the functions are well documented in code, in that the output of trace to me reads like a doc!

[1] http://www.lispworks.com/documentation/lw70/IDE-M/html/ide-m...


I'm learning CL and whetting my appetite debugging a sizeable project with SBCL/SLIME. When I trace a certain method the system goes nuts because it reports on _all_ methods of that name and they are called a lot. What I want is to trace just the method of my request and nothing more.

Instead I get flooded with useless information. Any recommendation?


In LispWorks, tracing method is possible [1], don't know how to do that with SBCL. Trace is implementation specific, so you have to check SBCL manual to trace methods.

See this gist for LW here: https://gist.github.com/dmsurti/8364dcd636829eaf83d1

You could also tailor trace with options as listed here. [2]

[1] http://www.lispworks.com/documentation/lw70/LW/html/lw-29.ht... [2] http://www.lispworks.com/documentation/lw70/LW/html/lw-27.ht...


For a starting point, see http://netzhansa.blogspot.no/2012/02/traces-of-awesomeness.h... , where Hans Hübner teaches how to do dynamically selective tracing with SBCL.


With CLOS, I'd consider adding a specific :around method for tracing a particular specialized method.


do you mean to add an :around method on the one I'm interested and trace that instead?


I really meant more like a wrapper printing the trace-in before (call-next-method) and trace-out after. A bit cumbersome though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: