Liking cljdoc? Tell your friends :D
All platforms.

com.noahbogart.cond-plus


=>clj/s

Only useful to silence linter errors.

Only useful to silence linter errors.
sourceraw docstring

cond+clj/smacro

(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 keyword :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 exception is thrown. If a body is not included, an exception 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 keyword `: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 exception is thrown.  If a `body` is not included, an exception is thrown.

`else` can be used instead of `:else`.
sourceraw docstring

elseclj/s

Only useful to silence linter errors.

Only useful to silence linter errors.
sourceraw docstring

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