I am trying to call a macro (defined somewhere else; I can't change it), but I want to evaluate some of the arguments before the macro is expanded. Is this possible?
(defmacro foo (&rest args) (mapcar (lambda (a) (message "arg: %s" a)) args) nil) (foo b (+ 1 1) c) ;; Prints: ;; arg: b ;; arg: (+ 1 1) ;; arg: c ;; But I want: ;; arg: b ;; arg: 2 ;; arg: c
The only way I've found so far is:
(eval `(foo b ,(+ 1 1) c))
Is there a better way?