Add fn! macro

For cl-function version of lambda, for implicit destructuring of
arguments.
This commit is contained in:
Henrik Lissner 2020-05-20 15:32:34 -04:00
parent 4c61f22132
commit 35b99fb272
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -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."