View difference between Paste ID: 13sRFrGV and TARPqSev
SHOW: | | - or go back to the newest paste.
1-
;;; I have the following function that wraps a form in a macrolet:
1+
2
  ``(bar ,,form))
3
4
(defun wrap-2 (form)
5-
     ,form)))
5+
6
                `(bar ,macro-arg)))
7-
;;; If I call it like this (wrap-2 'some-form) I get:
7+
     ,form))
8-
(macrolet ((foo (macro-arg)
8+
;; (MACROLET ((FOO (MACRO-ARG)
9-
             `(bar ,macro-arg)))
9+
;;              `(BAR ,MACRO-ARG)))
10-
  some-form)
10+
;;   SOME-FORM)
11
12-
;;; But I also have the following function that wraps a form:
12+
(defun wrap-3 (form)
13
  `(macrolet ((foo (macro-arg)
14-
  `(bar ,form))
14+
                ,(wrap-1 'macro-arg)))
15
     ,form))
16-
;;; How can I call wrap-1 from inside wrap-2 so that the
16+
;; (MACROLET ((FOO (MACRO-ARG)
17-
;;; expansion resulting from a call to wrap-2 remains the same?
17+
;;              `(BAR ,MACRO-ARG)))
18
;;   SOME-FORM)