(macrolet ((with-gensym ((name) &body body) `(macrolet ((,name () '',(gensym))) ,@body))) (with-gensym (f1) (with-gensym (f2) (defmacro set-x1 (value &body body) `(macrolet ((,(f1) () ,value)) ,@body)) (defmacro set-x2 (value &body body) `(macrolet ((,(f2) () ,value)) ,@body)) (defmacro read-x1-x2 (&environment env) `(list ',(macroexpand-1 `(,(f1)) env) ',(macroexpand-1 `(,(f2)) env)))))) (defmacro expand-via-function (form &environment env) (ecase 1 (0 (sb-cltl2:macroexpand-all form env)) (1 `',(sb-cltl2:macroexpand-all `',form env)) (2 (agnostic-lizard:macroexpand-all form (make-instance 'agnostic-lizard:metaenv :fallback-env env))) (3 `(agnostic-lizard:macro-macroexpand-all ,form)))) (set-x1 1 (set-x2 2 (expand-via-function (set-x2 3 (read-x1-x2)))))