On Oct 26, 3:49 pm, Phil Jordan <[EMAIL PROTECTED]> wrote:
> 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?
>
Yes. You can no longer embed unreadable objects in code, in this case
fn constants. This is to support ahead-of-time compilation - every
constant must have a readable print representation.
I've added an unreadable #<...> form, made it the default for print-
method, and added a check for unreadable forms in in-code constants
and throw during compilation, in order to move the detection of this
problem to compilation time vs. class initialization time.
Rich
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---