Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 1 KB

0129-trivial-with-current-source-form.org

File metadata and controls

29 lines (23 loc) · 1 KB

trivial-with-current-source-form

This library is a compatibility layer. It helps to provide hints to the Lisp compiler. Hints allow the compiler to show more precise error messages when error happens during the macro-expansion.

Here is an example I’ve stolen from the library’s documentation. To show you how this works in dynamic, I’ve recorded a GIF image.

Pay attention, without the hint compiler highlights “even-number-case” top-level form:

../../media/0129/with-current-source-form.gif

That is it. You just wrap some part of the macro-processing code with with-current-source-form and say: “Hey, compiler! Here is the s-expr I’m currently processing. If some shit will happen, let the user know.”

As I said before, this library is a compatibility layer. Only SBCL and Clasp are supported for now. On other implementations, the macro will do nothing.