On Mar 1, 2:40 pm, Seth <wbu...@gmail.com> wrote: > > So, combine the ClassLoader hackery with slapping "implements > > Serializable" on clojure.lang.IFn? > > Actually, I just looked at the implementation code -and this is not > true. Actually, a variadic function is of type RestFn and otherwise it > is of type AFunction. Restfn extends AFunction, and AFunction already > implements Serializable. > > So heres what causes the changing names - > > In > Compiler.javahttps://github.com/richhickey/clojure/blob/master/src/jvm/clojure/lan... > > In the below method of the FnExpr class > static Expr parse(C context, ISeq form, String name) throws Exception > > it creates a string name with the following > fn.name = basename+simpleName (around line 3137) > > and then at the end, it calls fn.getCompiledClass() - which uses > defineClass > to create a class using the compiled bytecode and the function name. > > So - it seems we need to either change this behavior to not generate > random classes (but there is probably a reason for this?), or to use > a custom classloader (seems better).
Ah - yes - I'd forgotten about my concerns about function name collisions whilst I battled with getting the class-name:bytecode map sorted out. If I went with a custom classloader it would also resolve the issues that I am having around trying to use load time aspect weaving to achieve the same thing. I guess I need to take a look at the links to other clojure apps which implement their own classloading which were posted further up this thread. Thanks for pointing this out. Jules -- 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