Advertisement
Guest User

Backquote question

a guest
Sep 13th, 2018
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.52 KB | None | 0 0
  1. ;;; I have the following function that wraps a form in a macrolet:
  2. (defun wrap-2 (form)
  3.   `(macrolet ((foo (macro-arg)
  4.                 `(bar ,macro-arg)))
  5.      ,form)))
  6.  
  7. ;;; If I call it like this (wrap-2 'some-form) I get:
  8. (macrolet ((foo (macro-arg)
  9.              `(bar ,macro-arg)))
  10.   some-form)
  11.  
  12. ;;; But I also have the following function that wraps a form:
  13. (defun wrap-1 (form)
  14.   `(bar ,form))
  15.  
  16. ;;; How can I call wrap-1 from inside wrap-2 so that the
  17. ;;; expansion resulting from a call to wrap-2 remains the same?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement