Skip to content

clojure.core/fn?

View this page on ClojureDocs

Type: function Added: Clojure 1.0 Examples: 2 Runnable: 2
([x])

Returns true if x implements Fn, i.e. is an object created via fn.

Examples

by dpritchett on
by Dimagog on

Note by bfontaine

Note fn? only tests if something was created using fn, not if it’s a function. Use ifn? for that. Some things are functions even though they weren’t created with fn, such as maps, vectors and keywords.

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.