mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
feat(lib): add eval-when-compile! macro
Unlike eval-when-compile, the body of this macro's calls will only be evaluated while byte-compiling.
This commit is contained in:
@ -286,6 +286,14 @@ See `eval-if!' for details on this macro's purpose."
|
|||||||
(when (eval cond)
|
(when (eval cond)
|
||||||
(macroexp-progn body)))
|
(macroexp-progn body)))
|
||||||
|
|
||||||
|
(defmacro eval-when-compile! (&rest body)
|
||||||
|
"Evaluate BODY *only* during byte-compilation.
|
||||||
|
|
||||||
|
Unlike `eval-when-compile', which is equivalent to `progn' in interpreted code,
|
||||||
|
this macro's BODY will only be evaluated during byte-compilation."
|
||||||
|
(declare (indent 0))
|
||||||
|
(when (bound-and-true-p byte-compile-current-file)
|
||||||
|
(ignore (eval (macroexp-progn body) t))))
|
||||||
|
|
||||||
;;; Closure factories
|
;;; Closure factories
|
||||||
(defmacro lambda! (arglist &rest body)
|
(defmacro lambda! (arglist &rest body)
|
||||||
|
Reference in New Issue
Block a user