Re: (dir *ns*) doesn't work??

2011-10-27 Thread Matjaz Gregoric
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

Re: (dir *ns*) doesn't work??

2011-10-27 Thread Ben Smith-Mannschott
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

Re: (dir *ns*) doesn't work??

2011-10-27 Thread jaime
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