Thanks, the command you wrote indeed works, but I cant get it to work
for just 'some' function I defined in the repl.
Here's my repl transcript, let me know what I'm doing wrong

user=> (def f (let [a 5] (fn [x] (+ x a))))
#'user/f
user=> (f 6)
11
user=> (read-string (with-out-str (source f)))
Source

thanks
   Oded

On Jul 2, 11:20 pm, Shantanu Kumar <kumar.shant...@gmail.com> wrote:
> To get the source form of the function "map?":
>
> (read-string (with-out-str (source map?)))
>
> This may not work only when the function has been AOT'ed already. Hope
> this helps.
>
> Regards,
> Shantanu
>
> On Jul 2, 11:34 am, Oded Badt <odedb...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hey,
>
> > Does anyone know of a way, given a function, to discover it's closure
> > programatically?
> > I often find myself holding a pointer to such a function that only
> > when knowing to what values it is bound to one can tell what it
> > actually does.
>
> > So it can be very helpful to be able to query the runtime (generally
> > in the repl) what the function is bound to
>
> > thanks
> >    Oded

-- 
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