Re: finding clojure functions from the mangled names

2016-12-09 Thread Sean Corfield
Ah yes, macros… That can throw a wrench in things b/c your source code and the compiled code no longer bear much resemblance to each other L Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really

Re: finding clojure functions from the mangled names

2016-12-09 Thread Brian Craft
It doesn't, really, because you can't tell how nested functions are in clojure due to all the macros. In my code it wasn't nested at all, but I see now that defmethod and core.match added nested anonymous functions. On Friday, December 9, 2016 at 4:32:51 PM UTC-8, Sean Corfield wrote: > > How

Re: finding clojure functions from the mangled names

2016-12-09 Thread Sean Corfield
How big a piece of code is clojure.something100/foo ? That sort of name indicates nested anonymous functions inside foo, nested three deep in this case. That should narrow it down quite a bit. (if you give us real names, that might help, especially if it’s in a well-known third party

Re: finding clojure functions from the mangled names

2016-12-09 Thread Brian Craft
This is in a profiler, not a repl: visualvm. If there's a way to make visualvm aware of clojure fns, I'll be very happy. On Friday, December 9, 2016 at 3:52:38 PM UTC-8, Ghadi Shayban wrote: > > The stacktrace should be pointing to the correct file & line number -- no > need to reverse

Re: finding clojure functions from the mangled names

2016-12-09 Thread Ghadi Shayban
The stacktrace should be pointing to the correct file & line number -- no need to reverse engineer the mangling. If it's not for some reason, file a bug. (It's helpful to eliminate nREPL / lein middleware in case something is transforming the printing of traces) If you are missing a trace

Re: finding clojure functions from the mangled names

2016-12-09 Thread Brian Craft
Well, a truly painful way is to dump the const__ fields on the class, which appear to be values in the closure, from which the function might be inferred. Like (. foo$fn__7840$fn__7846$fn__7847 const__0) (. foo$fn__7840$fn__7846$fn__7847 const__1) ... On Friday, December 9, 2016 at 3:25:24

Re: finding clojure functions from the mangled names

2016-12-09 Thread Brian Craft
Yes, but not very practical: since I don't know which one to change, this would be a huge rewrite of code to eliminate #() and (fn []). On Friday, December 9, 2016 at 3:16:06 PM UTC-8, Alex Engelberg wrote: > > If you're seeing "fn_123", it's probably coming from an anonymous > function.

Re: finding clojure functions from the mangled names

2016-12-09 Thread Alex Engelberg
If you're seeing "fn_123", it's probably coming from an anonymous function. Giving those functions a name with the (fn my-name [] ...) syntax will make the stack trace a little easier to decipher: user=> ((fn [] (/ 1 0))) ArithmeticException Divide by zero clojure.lang.Numbers.divide

finding clojure functions from the mangled names

2016-12-09 Thread Brian Craft
Trying to profile some code, and the stack traces look like clojure.something0 clojure.something1 clojure.something2 clojure.something100 foo$fn_1000$fn_1002$fn_10003.invoke() How can I figure out what that last function is? I can access the symbol from the repl,