Hi,

I'm having some trouble with existing code after a recent svn update. I
think it must have happened sometime in the last 2 or so weeks, but it
might be slightly longer.

The problematic code can be reduced to this:

user=> (def mylocals ['A (fn [] "foo")])
#=(var user/mylocals)

user=> (defmacro letlocals [locals & body]
        (list* 'let (eval  locals) body))
nil

user=> mylocals
[A #=(user.fn__4291. "[EMAIL PROTECTED]")]

user=> (letlocals mylocals (A))
java.lang.ExceptionInInitializerError (NO_SOURCE_FILE:0)
java.lang.RuntimeException: java.lang.ClassNotFoundException: user.fn__4291

Now, I realise that the use of such patterns is probably bad form (any
suggestions for a replacement welcome!) but this definitely used to
work, and I don't understand why it doesn't anymore.

First of all, is the breakage intentional?

Secondly, you don't get that last error line with current clojure
builds, that's a local change (the *only* local change, I've not been
messing around) to help me track down the problem:

Index: trunk/src/jvm/clojure/lang/Repl.java
===================================================================
--- trunk/src/jvm/clojure/lang/Repl.java        (revision 1080)
+++ trunk/src/jvm/clojure/lang/Repl.java        (working copy)
@@ -102,6 +102,8 @@
                                while(c.getCause() != null)
                                        c = c.getCause();
                                ((PrintWriter) RT.ERR.get()).println(e
instanceof Compiler.CompilerException ? e : c);
+                               if (e.getCause() instanceof
ExceptionInInitializerError)
+                                       ((PrintWriter)
RT.ERR.get()).println(((ExceptionInInitializerError)e.getCause()).getException());
                                stare.set(e);
                                }
                        }

It's a terrible hack of course, but
java.lang.ExceptionInInitializerError's toString() method is pretty
useless, unfortunately.

Equally unfortunate is that
java.lang.ClassNotFoundException: user.fn__4291
doesn't make any sense at all to me, as the class clearly exists: I can
call the function via

user=> ((mylocals 1))
"foo"

Any help in figuring this one out is greatly appreciated!
Thanks,

~phil
(back to using Clojure after an unavoidable break)

--~--~---------~--~----~------------~-------~--~----~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to