From 88cd65ae0baa7f4779dda0207ab51a4720ad291d Mon Sep 17 00:00:00 2001 From: Christian Egli Date: Fri, 17 Jun 2022 12:16:51 +0200 Subject: [PATCH] Use markdown in comments for better display --- src/cljc/de/otto/nom/core.cljc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/cljc/de/otto/nom/core.cljc b/src/cljc/de/otto/nom/core.cljc index 41f2b4b..abdc0f9 100644 --- a/src/cljc/de/otto/nom/core.cljc +++ b/src/cljc/de/otto/nom/core.cljc @@ -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) @@ -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."