(defn increment "Add one." [n] (+ n 1)) (increment 41) (defn sum ([] 0) ([x] x) ([x y ... more] (reduce :+ (+ x y) more))) [(sum) (sum 2) (sum 2 3 4 5)] (def odd?) (defn even? [n] (if (= n 0) true (odd? (- n 1)))) (defn odd? [n] (if (= n 0) false (even? (- n 1)))) [(even? 10) (odd? 9)] (defn scale {dust/doc "Multiply by two." category "example"} [n] (* n 2)) (scale 21) (defn identity-with-doc "Constructor note\nParameter note" [x] x) (str identity-with-doc) (defn no-body []) (no-body) (= (str identity-with-doc) (str (fn "Constructor note\nParameter note" [x] x))) (let [doc (documents/from-value identity-with-doc) bytes (encoding/tron/encode doc) closed (documents/close doc) copy (encoding/tron/decode bytes) same (= bytes (encoding/tron/encode copy)) text (encoding/dust/encode copy) closed-copy (documents/close copy)] [same (strings/includes? text "Constructor note") (strings/includes? text "Parameter note")]) (defn muted-definition #mute "ignored documentation" [x] #mute (get missing "value") x) (muted-definition 42) (= (str muted-definition) (str (fn [x] x)))