On Sun, Feb 13, 2011 at 10:14 PM, Seth <wbu...@gmail.com> wrote:
> oh, and of course the funuction needs to be executable (they are after
> all just functions with metadata) - so we cant use ifn?, which would
> return true on record!

The map? function also returns true on a record, and false on a deftype, so

#(and (ifn? %) (not (or (map? %) (vector? %) (set? %) (keyword? %))))

looks like it might fit the bill as a predicate that excludes records
and normal maps (along with sets, vectors, and keywords) and includes
"true" functions and deftypes that implement IFn (but not
IPersistentMap, that makes map? return true).

As for fn? being all through your code -- might I suggest search and
replace? Failing that there's always

(ns foo
  (:refer-clojure :exclude [fn?])
  ...)

(defn fn? [x]
  (and (ifn? x) (not (or (map? x) (vector? x) (set? x) (keyword? x)))))

or something of the sort.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to