Hello,
I am new to clojure, and I am trying to define a function that turns a
function-name into a string, but I am stuck.
Here is what I tried:
user> (defn some-func []
true)
I am looking for a function stringify that would do the following
user> (stringify some-func)
"some-func"
I can do it with var as long it is not wrapped in a defn-form:
user> (second (clojure.string/split (str (var some-func)) #"/"))
However, if I try to put it into a defn, I get an error:
user> (defn stringify [func]
(second (clojure.string/split (str (var func)) #"/")))
CompilerException java.lang.RuntimeException: Unable to resolve var: func in
this context, compiling:(/tmp/form-init6959523461952831160.clj:2:37)
What am I missing here?
Thanks in advance...
--
--
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
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.