Add cond! macro to core-lib
An anaphoric cond.
This commit is contained in:
parent
854d8ce00a
commit
103612a347
1 changed files with 7 additions and 0 deletions
|
@ -181,6 +181,13 @@ The order VALUES is preserved."
|
|||
elt)
|
||||
,list)))
|
||||
|
||||
(defmacro cond! (&rest clauses)
|
||||
"An anaphoric `cond', which stores the conditional value in `it'."
|
||||
`(let (it)
|
||||
(cond ,@(cl-loop for (cond . body) in clauses
|
||||
collect `((setq it ,cond)
|
||||
,@body)))))
|
||||
|
||||
(defmacro defer-until! (condition &rest body)
|
||||
"Run BODY when CONDITION is true (checks on `after-load-functions'). Meant to
|
||||
serve as a predicated alternative to `after!'."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue