Main public API for the Infix syntax library.
Main public API for the Infix syntax library.
(infix & expr)Transform infix expressions into Clojure forms.
Example: (infix a + b * c) => (+ a (* b c)) (infix x => x * x) => (fn [x] (* x x))
Transform infix expressions into Clojure forms. Example: (infix a + b * c) => (+ a (* b c)) (infix x => x * x) => (fn [x] (* x x))
(infix-defn fn-name & args)Define a function with infix expressions in the body.
Example: (infix-defn square [x] x * x) => (defn square [x] (* x x))
Define a function with infix expressions in the body. Example: (infix-defn square [x] x * x) => (defn square [x] (* x x))
(infix-let bindings & body)Sequential bindings with infix expressions on the right-hand side.
Example: (infix-let [a (1 + 2) b (a * 4)] b + 10) => (let [a (+ 1 2) b (* a 4)] (+ b 10))
Sequential bindings with infix expressions on the right-hand side. Example: (infix-let [a (1 + 2) b (a * 4)] b + 10) => (let [a (+ 1 2) b (* a 4)] (+ b 10))
(return value)Early return from infix-defn functions.
Example: (infix-defn safe-div [x y] (when y = 0 (return nil)) x / y)
Early return from infix-defn functions.
Example:
(infix-defn safe-div [x y]
(when y = 0 (return nil))
x / y)(throw-return value)Throw special exception for early returns. Used by the return macro.
Throw special exception for early returns. Used by the return macro.
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 |