On Tue, Nov 18, 2008 at 12:37 PM, Konrad Hinsen
<[EMAIL PROTECTED]>wrote:

>
> Is there a way to recover readable source code from a compiled
> function in Clojure? Debugging things like "[EMAIL PROTECTED]" is
> not much fun. It would already be a great help to be able to find out
> from where in the source code the function was compiled.
>
> Konrad.


For functions defined in libs that you load into Clojure, you can find out
the file and line from the metadata. For functions you define in the REPL,
this trick won't help. Say you have (defn myfn [] :test) in the user
namespace. ^#'user/myfn gets the metadata from the var that holds the
function. To get the file try (:file ^#'user/myfn). And for the line number,
(:line ^#'user/myfn).

Shawn

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

Reply via email to