Hello,
Apologies if this there is an obvious documented answer to this
question. If I write a function:
(defn example
"Get info about a function"
[f]
(println "Arity is" (arity f))
(if (is-anonymous? f)
(println "Function is anonymous")))
I believe I can implement is-anonymous as:
(defn is-anonymous?
"Indicates if the given function is anonymous"
[f]
(re-find #"\$eval\d+\$" (str f))
But I have no idea how to find an arity of a function. Is there a
better way of finding if a function is anonymous and is it possible to
find the arity?
Thanks in advance for any help.
Saul
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en