diff options
-rw-r--r-- | src/boot.clj | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/boot.clj b/src/boot.clj index 66ae81e0..c023c3a0 100644 --- a/src/boot.clj +++ b/src/boot.clj @@ -2291,12 +2291,14 @@ not-every? (comp not every?)) (defmacro if-let "if test is true, evaluates then with binding-form bound to the value of test, if not, yields else" - [binding-form test then else] - `(let [temp# ~test] - (if temp# - (let [~binding-form temp#] - ~then) - ~else))) + ([binding-form test then] + `(if-let ~binding-form ~test ~then nil)) + ([binding-form test then else] + `(let [temp# ~test] + (if temp# + (let [~binding-form temp#] + ~then) + ~else)))) (defmacro when-let "when test is true, evaluates body with binding-form bound to the value of test" |