Here are some different syntax options for defining functions in Clojure.
Most explicit to most implicit, longest to shortest. Repetition of the same function body.
The one you'll see the most is with the
(defn is-published? [x] (not= "true" (:draft x))
Next choice: Use fn. Shorter. Can be anonymous. Can define and bind within a
let expression within
(fn name? [params*] exprs*)
(let [is-published? (fn [x] (not= "true" (:draft x)))])
defn is actually a macro for:
(def is-published? (fn [x] (not= "true" (:draft x)))
No outer parens. No name, ever. No named params:
(let is-published? #(not= "true" (:draft %)))