• (function? x)
Returns true if argument is a function or a symbol that resolves to
a function (not a macro).

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/test.clj:403 top

(defn function?
  "Returns true if argument is a function or a symbol that resolves to
  a function (not a macro)."
  {:added "1.1"}
  [x]
  (if (symbol? x)
    (when-let [v (resolve x)]
      (when-let [value (get-possibly-unbound-var v)]
        (and (fn? value)
             (not (:macro (meta v))))))
    (fn? x)))
Vars in clojure.contrib.test-is/function?: and defn fn? meta not symbol? when-let
Used in 0 other vars

Comments top

No comments for function?. Log in to add a comment.