Plaster

common-lisp
(defmacro test-macro-1 (operation arg) `(,(funcall operation) ,arg)) (defmacro test-macro-2 (arg) (let ((f (lambda () 'print))) `(test-macro-1 ,f ,arg))) ;;;; (macroexpand-1 '(test-macro-2 1)) => (TEST-MACRO-1 #<FUNCTION (LAMBDA () :IN TEST-MACRO-2) {53B128EB}> 1) (test-macro-2 'hello) => HELLO (defclass test-operation () ()) (defmethod generate-expansion ((x test-operation)) 'print) (defmacro test-macro-3 (operation arg) `(,(generate-expansion operation) ,arg)) (defmacro test-macro-4 (class arg) `(test-macro-3 ,(make-instance class) ,arg)) (test-macro-4 test-operation 'hello) => HELLO