Perry Trolard wrote:
> You can get the symbol that names the function from the Var's
> metadata, like:
>
> user=> (:name (meta (var =)))
> =
Thank you Perry.
What is (var ...)? I didn't find it in the api docs, nor in the Vars
and Environment page.
I'm yet to make your code work for my specific needs:
(defn with-test-report [test fn]
(let [assert# (first test)
expect# (second test)
params# (last test)
result# (assert# expect# (apply fn params#))]
(if result#
(print ".")
(do (newline)
(println (format "FAIL: %s" (:name (meta (var
expect#)))))))
result#))
Exception: Unable to resolve var: expect# in this context
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---