Skip to content

Commit

Permalink
same
Browse files Browse the repository at this point in the history
  • Loading branch information
frenchy64 committed Aug 23, 2024
1 parent 9edac53 commit 818bfdc
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/com/ambrosebs/map.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 818bfdc

Please sign in to comment.