mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Add fn! macro
For cl-function version of lambda, for implicit destructuring of arguments.
This commit is contained in:
@ -264,6 +264,13 @@ See `if!' for details on this macro's purpose."
|
|||||||
(macroexp-progn body)))
|
(macroexp-progn body)))
|
||||||
|
|
||||||
|
|
||||||
|
;;; Closure factories
|
||||||
|
(defmacro fn! (arglist &rest body)
|
||||||
|
"Expands to (cl-function (lambda ARGLIST BODY...))"
|
||||||
|
(declare (indent defun) (doc-string 1) (pure t) (side-effect-free t))
|
||||||
|
`(cl-function (lambda ,arglist ,@body)))
|
||||||
|
|
||||||
|
|
||||||
;;; Mutation
|
;;; Mutation
|
||||||
(defmacro appendq! (sym &rest lists)
|
(defmacro appendq! (sym &rest lists)
|
||||||
"Append LISTS to SYM in place."
|
"Append LISTS to SYM in place."
|
||||||
|
Reference in New Issue
Block a user