From 818bfdc63fb7541dd22933f8a10eab5b10052a39 Mon Sep 17 00:00:00 2001 From: Ambrose Bonnaire-Sergeant Date: Fri, 23 Aug 2024 16:58:07 -0500 Subject: [PATCH] same --- src/com/ambrosebs/map.clj | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/com/ambrosebs/map.clj b/src/com/ambrosebs/map.clj index e6b7aeb..86a6f07 100644 --- a/src/com/ambrosebs/map.clj +++ b/src/com/ambrosebs/map.clj @@ -28,17 +28,17 @@ ;; does not test keywords (defmacro cond [& [c1 c2 :as clauses]] - (when clauses - (when-not (next clauses) - (throw (IllegalArgumentException. - "cond requires an even number of forms"))) - (if (keyword? c1) - c2 - (list 'if c1 - c2 - (let [nnclauses (next (next clauses))] - (assert nnclauses "Final clause must be keyword test") - (cons `cond nnclauses)))))) + (assert clauses "Final clause must be keyword test") + (when-not (next clauses) + (throw (IllegalArgumentException. + "cond requires an even number of forms"))) + (if (keyword? c1) + c2 + (list 'if c1 + c2 + (let [nnclauses (next (next clauses))] + (assert nnclauses "Final clause must be keyword test") + (cons `cond nnclauses))))) (defonce ^:private NOT-FOUND