Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stylistic changes in the doc strings #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/cljc/de/otto/nom/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
(defn fail
"Construct a new anomaly with the given `category`. Accepts either keyword
arguments or a map with further data.
Example: (= [::anomaly :nonono {:foo 1 :bar 2}]

Example:
```
(= [::anomaly :nonono {:foo 1 :bar 2}]
(fail :nonono :foo 1 :bar 2)
(fail :nonono {:foo 1 :bar 2}))"
(fail :nonono {:foo 1 :bar 2}))
```"
[category & more]
;; This map conversion can be inlined into the lambda list in Clojure 1.11
(let [more-map (cond (map? (first more)) (first more)
Expand Down Expand Up @@ -121,8 +125,8 @@
value is an anomaly, returns that anomaly. Otherwise, evaluate the rest of
the form (without the `nom`).

Example: (nom foo bar) — if any of nom, foo, or bar is an anomaly, returns
that; otherwise calls and returns (foo bar).
Example: `(nom foo bar)` — if any of nom, foo, or bar is an anomaly, returns
that; otherwise calls and returns `(foo bar)`.

Because this is a macro that expands to a conditional and the wrapped form,
arities are checked normally by compiler and runtime."
Expand Down