path: root/cider-compat.el
diff options
authorArtur Malabarba <>2016-05-01 23:19:42 -0300
committerArtur Malabarba <>2016-05-01 23:21:00 -0300
commit1f6fc8d64d50b24fa87491e6b208872cff5ef11d (patch)
tree0d400cc34eea1256a4091e4b028cc31b2910adb8 /cider-compat.el
parent72886462beee998e1420cc6830618efbd55d928a (diff)
[Fix #1712] Check if when-let is defined even when if-let is
Diffstat (limited to 'cider-compat.el')
1 files changed, 5 insertions, 5 deletions
diff --git a/cider-compat.el b/cider-compat.el
index fc53306c..9585a520 100644
--- a/cider-compat.el
+++ b/cider-compat.el
@@ -28,8 +28,7 @@
- (unless (fboundp 'thread-first)
+ (unless (fboundp 'internal--thread-argument)
(defmacro internal--thread-argument (first? &rest forms)
"Internal implementation for `thread-first' and `thread-last'.
When Argument FIRST? is non-nil argument is threaded first, else
@@ -39,8 +38,9 @@ last. FORMS are the expressions to be threaded."
,first? ,(if first? `(,f ,x ,@args) `(,f ,@args ,x)) ,@rest))
(`(,x ,f . ,rest) `(internal--thread-argument ,first? (,f ,x) ,@rest))
- (_ (car forms))))
+ (_ (car forms)))))
+ (unless (fboundp 'thread-first)
(defmacro thread-first (&rest forms)
"Thread FORMS elements as the first argument of their successor.
@@ -59,7 +59,6 @@ threading."
`(internal--thread-argument t ,@forms)))
(unless (fboundp 'thread-last)
(defmacro thread-last (&rest forms)
"Thread FORMS elements as the last argument of their successor.
@@ -142,8 +141,9 @@ to bind a single value, BINDINGS can just be a plain tuple."
`(let* ,(internal--build-bindings bindings)
(if ,(car (internal--listify (car (last bindings))))
- ,@else)))
+ ,@else))))
+ (unless (fboundp 'when-let)
(defmacro when-let (bindings &rest body)
"Process BINDINGS and if all values are non-nil eval BODY.
Argument BINDINGS is a list of tuples whose car is a symbol to be