> 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.java
https://github.com/richhickey/clojure/blob/master/src/jvm/clojure/lang/Compiler.java

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

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

Reply via email to