java -jar lib/clojure-1.3.0.jar 
user=> (defn qw []
  (inc 2))
#'user/qw
user=> (use 'clojure.repl)
nil
user=> (clojure.repl/source-fn qw)
ClassCastException user$qw cannot be cast to clojure.lang.Symbol 
 clojure.core/ns-resolve (core.clj:3879)
user=> (clojure.repl/source-fn 'qw)
nil
user=> (println (clojure.repl/source-fn 'qw))
nil
nil
user=>

What am I doing wrong?

On Saturday, March 3, 2012 4:18:35 AM UTC+2, Mark Rathwell wrote:
>
> (clojure.repl/source-fn 'qw) will give you the source.
>
> On Fri, Mar 2, 2012 at 10:32 AM, Nikem <gni...@gmail.com> wrote:
> > Hi.
> >
> > Is it possible to pretty print a source code of the function defined
> > with defn? I have tried the following:
> >
> > (defn qw []
> >  (inc 2))
> >
> > (with-pprint-dispatch code-dispatch (pprint qw))
> >
> > And got #<user$qw user$qw@4743bf3d>. But I would like to get at least
> > "(inc 2)". Is it possible at all?
> >
> > Nikem
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to clojure@googlegroups.com
> > Note that posts from new members are moderated - please be patient with 
> your first post.
> > To unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to