Re: decoding clojure generated class names

2015-08-23 Thread Dave Tenny
Thanks Alex, clojure.lang.Compiler/demunge is just what I wanted. On Sat, Aug 22, 2015 at 7:28 PM, Alex Miller wrote: > There is a demunge function in clojure.lang.Compiler. It's not foolproof > as the munging is not unambiguously reversible. > > -- > You received this message because you are su

Re: decoding clojure generated class names

2015-08-22 Thread Alex Miller
Yes. Specifically, - and _ both map to _ so foo-bar and foo_bar generate the same class name. So don't do that. -- 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 mem

Re: decoding clojure generated class names

2015-08-22 Thread Fluid Dynamics
On Saturday, August 22, 2015 at 7:28:32 PM UTC-4, Alex Miller wrote: > > There is a demunge function in clojure.lang.Compiler. It's not foolproof > as the munging is not unambiguously reversible. If the munging process loses information, isn't there a (theoretical, at least) risk of name collis

decoding clojure generated class names

2015-08-22 Thread Alex Miller
There is a demunge function in clojure.lang.Compiler. It's not foolproof as the munging is not unambiguously reversible. -- 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 fro

Re: decoding clojure generated class names

2015-08-22 Thread Colin Fleming
Hi Dave, All the various stacktrace-prettifying libraries (clj-stacktrace, Aviso pretty etc) all do this - check their code out for some examples. Cheers, Colin On 23 August 2015 at 01:07, Dave Tenny wrote: > I wanted to write a function like this: > > (defn fn-name-info > "Given a function,

decoding clojure generated class names

2015-08-22 Thread Dave Tenny
I wanted to write a function like this: (defn fn-name-info "Given a function, try to deduce the function name and clojure namespace by looking at the function's java class name and decoding stuff. Return a vector of name, namespace strings, or nil if we can't find anything. For exa