> I'd also like function? and macro? as an alternative to checking the
> metadata for :macro set to true.

Forgive my parital answer to the intial query of the thread, but
regarding a function? predicate, it's already included:

user=> (doc fn?)
-------------------------
clojure.core/fn?
([x])
  Returns true if x implements Fn, i.e. is an object created via fn.
nil
user=> (doc ifn?)
-------------------------
clojure.core/ifn?
([x])
  Returns true if x implements IFn. Note that many data structures
  (e.g. sets and maps) implement IFn
nil


Regarding macro?, it's use seems limited by the fact that macros are
not self-evaluating like functions, so the macro? predicate would have
to be a macro, which means it can't be passed to other functions, etc.
But its implementation would of course be:

  (defmacro macro? [x] `(:macro (meta (var ~x))))


Perry


--~--~---------~--~----~------------~-------~--~----~
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
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