I am new at Lisp, and am trying different things out to improve my skills. I want to write a macro that wraps existing functions so that I can set up before and after forms for these functions, kind of like CLOS’s auxilliary methods or Elisp’s advice package. The trace function’s ability to wrap code dynamically has intrigued me, and it seems useful to be able to do this myself.
How can I do this?
Please note that I am using SBCL, and that, for the purposes of this question, I am not interested so much in the “right” way of doing this as I am in adding to my Lisp trick bag.
I don’t know of any built-in support for this outside of CLOS. But you could just redefine the original function, like this: