Liking cljdoc? Tell your friends :D

com.noahbogart/cond-plus

Clojars Project cljdoc badge

An adaption of the Racket cond macro for Clojure.

Details can be found in the docs.

Example

(require '[com.noahbogart.cond-plus :refer [cond+]])

(cond+)
=> nil

(cond+
  [false 10]
  [:else 5])
=> 5

(let [i -5]
  (cond+
    [(pos? i) "doesn't get here"]
    [(zero? i) "doesn't get here, either"]
    [(neg? i) :here]))
=> :here

(cond+
  [(next [1 2 3]) :> (fn [x] (map - x))])
=> [-2 -3]

(cond+
  [(next [1 2 3])])
=> [2 3]

License

Copyright © Noah Bogart

Distributed under the Mozilla Public License version 2.0.

Can you improve this documentation?Edit at git repository

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close