I read https://github.com/lunaryorn/blog/blob/master/posts/byte-compiling-eval-after-load.md which contains this code:
(defmacro stante-after (feature &rest forms)
`(,(if (or (not byte-compile-current-file)
(if (symbolp feature)
(require feature nil :no-error)
(load feature :no-message :no-error)))
'progn
(message "stante-after: cannot find %s" feature)
'with-no-warnings)
(eval-after-load ',feature
`(funcall (function ,(lambda () ,@forms))))))
I read (info "(elisp)")
but can't find a strict statement that the inner macro is expanded before the outer one. I can't find the semantics of nested backquotes.
I understand that ,(lambda () ,@forms)
has a comma before lambda
in order to mark the form as functional and that triggers byte-compilation, but I can't figure out in which order that comma is interpreted by the backquote
macro.
macroexpand
. Without attempting to eval your code, I'd wait for a "comma outside backquote" error message, but that's because I'm used to Common Lisp, and it's a bit stricter in this regard. In other words, I don't think thatforms
will be replaced with the value of the argument, instead it will be undefined at the time the lambda is called. PS. What were you trying to achieve when you put a comma beforelambda
?(progn ...)
form it leave code for interpretation.cl-loop
aren't expanded before they are used to build loop code, but it's not uncommon to usemacroexpand
during macro expansion. I don't know of ELisp-specific examples, but CLiterate
library (unlikeloop
) expands them.