core-lib: add prependq! and appendq! macros
This commit is contained in:
parent
0f98b5b3c2
commit
b742bf086f
1 changed files with 8 additions and 0 deletions
|
@ -180,6 +180,14 @@ The order VALUES is preserved."
|
||||||
`(dolist (--value-- (nreverse (list ,@values)))
|
`(dolist (--value-- (nreverse (list ,@values)))
|
||||||
(cl-pushnew --value-- ,place)))
|
(cl-pushnew --value-- ,place)))
|
||||||
|
|
||||||
|
(defmacro prependq! (sym &rest lists)
|
||||||
|
"Prepend LISTS to SYM in place."
|
||||||
|
`(setq ,sym (append (list ,@lists) ,sym)))
|
||||||
|
|
||||||
|
(defmacro appendq! (sym &rest lists)
|
||||||
|
"Append LISTS to SYM in place."
|
||||||
|
`(setq ,sym (append ,sym ,@lists)))
|
||||||
|
|
||||||
(defmacro delq! (elt list &optional fetcher)
|
(defmacro delq! (elt list &optional fetcher)
|
||||||
"Delete ELT from LIST in-place."
|
"Delete ELT from LIST in-place."
|
||||||
`(setq ,list
|
`(setq ,list
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue