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

Closure for object pattern? A good idea?

2016-12-09 Thread Didier
I'm wondering what everyone thinks of using closures to mimic a simplistic object system in Clojure? I'm not sure what to think of it yet, but the idea is that you wrap object fields inside a closed function, and it returns a map of methods that operates over those fields. Here's an example of

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

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,

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

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 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: Spec of conform of spec

2016-12-09 Thread Leon Grapenthin
Alex, I thought about this and it appears to be a convenience problem. Spec is e. g. excellent to parse a e. g. a Query DSL (which is my current side project) via conform. But then you have that large data structure that you want to break down and operate on in several functions. So you need to

freqsort

2016-12-09 Thread dimitris
Hi all, I was just playing about with sorting the other day and I came up with the following. I'll say upfront that performance wasn't my goal, however the performance of `freqsort` caught me completely off guard! It's surprisingly decent to say the least... I'm truly amazed given that my

[ANN] oolong 0.4.0 - the cljs support release

2016-12-09 Thread James Laver
Hi all, We added cljs support to oolong and tidied it up a little bit. We now require clojure 1.7 for cljc support. https://github.com/irresponsible/oolong/ At this point oolong is considered relatively stable and is transitioning to maintenance mode, so we're still happy to take patches, but

Re: [ANN] An exploration of Hash Array Mapped Tries

2016-12-09 Thread Colin Fleming
Hi Ambrose, This looks very interesting, and I look forward to investigating it further when I have a moment. Once comment on the defrecords generated at runtime based on small keysets - I'd be very careful with this sort of optimisation, and it needs much more than micro-benchmarks to establish