Plaster
New
List
Login
common-lisp
default
anonymous
2023.11.06 16:55:46
;;; test macroexpand-all (via trivial-macroexpand-all) (defmacro at-compile-time ((&optional env) &body body) (let ((capture (gensym))) `(macrolet ((,capture (,@(when env `(&environment ,env))) ,@body)) (,capture)))) (ql:quickload :trivial-macroexpand-all) (defmacro NO-1 () ''YES-1) (define-symbol-macro NO-4 'YES-4) (macrolet ((NO-3 () ''YES-3)) (symbol-macrolet ((NO-6 'YES-6)) (at-compile-time (env) `',(trivial-macroexpand-all:macroexpand-all '(macrolet ((NO-2 () ''YES-2)) (symbol-macrolet ((NO-5 'YES-5)) (values (NO-1) (NO-2) (NO-3) NO-4 NO-5 NO-6))) env)))) #| results M = macro SM = symbol-macro | impl | global M | local (form) M | local (env) M | global SM | local (form) SM | local (env) SM | |---------+----------+----------------+---------------+-----------+-----------------+----------------| | sbcl | + | + | + | + | + | + | | cmucl | + | + | + | NO | + | NO | | ccl | + | + | + | + | + | + | | allegro | + | + | no arg | + | + | no arg | | ecl | + | NO | + | NO | + | NO | | abcl | + | + | + | + | + | + | | clisp | + | + | no arg | + | + | no arg | | LW | + | + | no arg | + | + | no arg | | corman | + | + | no arg, but + | + | + | no arg, but + | | mkcl | + | NO | no arg | NO | + | no arg | no-arg means that implementations doesn't support passing lexical environment to macroexpand-all. These are Allegro CL, LispWorks, CLISP, Corman CL. On Corman CL the lexical environment seems to be automatically captured when calling the macroexpand-all function. clasp doesn't have macroexpand-all. |#
Raw
Annotate
Repaste
Edit