The dir macro is quite picky in what it accepts as arguments. Try:
(dir user)
(dir clojure.core)
On Thu, Oct 27, 2011 at 10:57 AM, jaime xiejianm...@gmail.com wrote:
Hi there, when I tried to execute (dir *ns*) in REPL, I found it
doesn't work -- with exception of:
Exception No
dir is a macro. It doesn't evaluate its arguments. So when you say
(dir *ns*), Clojure sees: show me what's in the namespace named
*ns*, and there is no such namespace because *ns* is the name of a
variable which contains the name of the current namespace.
Dir is this way because for interactive
Oh yes you guys are right. I should have look at the source first:
(defmacro dir
Prints a sorted directory of public vars in a namespace
[nsname]
`(doseq [v# (dir-fn '~nsname)]
(println v#)))
from it, we can see the quote thing. Thank you all. I got it now!
On Oct 27, 5:12 pm, Ben