gilch / hissp

It's Python with a Lissp.
https://gitter.im/hissp-lang/community
Apache License 2.0
369 stars 9 forks source link

Write a debugger macro walkthrough. #179

Open gilch opened 1 year ago

gilch commented 1 year ago

Lisp code can be instrumented by rewriting it with a macro. I think CIDER does something similar for Clojure. It has always been the plan to demonstrate how to do code-walking macros in the Hissp documentation; the TODO has been in there for a while now. Ease of writing code-walking macros is also one of the stated benefits of Hissp having only two special forms.

The bundled macros do currently include spy# for debugging, and, of course, the Python debugger works fine on the compiled Python. Like the function literal macro, a debugging macro would probably be too complex to bundle, but a simple one probably wouldn't be too complex for a walkthrough. I think we could at least step through expressions and inspect locals.

173 would have to happen first.