Only useful to silence linter errors.
Only useful to silence linter errors.
(cond+ & clauses)Takes any number of clauses, which must be lists or vectors. The test-expr of the first clause is evaluated. If it's a logical true value (or the bare symbol else), then the rest of the clause is evaluated as described below and the resulting value is returned. Otherwise, repeat these steps for the next clauses. (cond+) returns nil.
clause = [test-expr & body]
| [test-expr :> fn-expr]
| [test-expr]
| [:else & body]
[test-expr & body]Evaluates body in an implicit do.
[test-expr :> fn-expr]fn-expr must be a function that accepts one argument. The result of the test-expr is passed to the fn-expr and that result is returned.
If an fn-expr is not provided or more than one form is included after the :>, an IllegalArgumentError is thrown.
The bare symbol => can be used instead of :>.
[test-expr]The result of the test-expr is returned.
[:else & body]Evaluates body in an implicit do.
If an :else is not the last cond-clause, an IllegalArgumentError is
thrown. If a body is not included, an IllegalArgumentError is thrown.
else can be used instead of :else.
Takes any number of clauses, which must be lists or vectors. The `test-expr` of the first clause is evaluated. If it's a logical true value (or the bare symbol `else`), then the rest of the clause is evaluated as described below and the resulting value is returned. Otherwise, repeat these steps for the next clauses. `(cond+)` returns `nil`.
```
clause = [test-expr & body]
| [test-expr :> fn-expr]
| [test-expr]
| [:else & body]
```
### `[test-expr & body]`
Evaluates `body` in an implicit `do`.
### `[test-expr :> fn-expr]`
`fn-expr` must be a function that accepts one argument. The result of the `test-expr` is passed to the `fn-expr` and that result is returned.
If an `fn-expr` is not provided or more than one form is included after the `:>`, an `IllegalArgumentError` is thrown.
The bare symbol `=>` can be used instead of `:>`.
### `[test-expr]`
The result of the `test-expr` is returned.
### `[:else & body]`
Evaluates `body` in an implicit `do`.
If an `:else` is not the last `cond-clause`, an `IllegalArgumentError` is
thrown. If a `body` is not included, an `IllegalArgumentError` is thrown.
`else` can be used instead of `:else`.Only useful to silence linter errors.
Only useful to silence linter errors.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |