On Nov 19, 10:07 am, Stuart Sierra <[EMAIL PROTECTED]>
wrote:
> Hmm, it seems strange to me that this works at all:
>
> user=> (eval '(list + 1 2 3))
> (#<core$_PLUS___2848 [EMAIL PROTECTED]> 1 2 3)
> user=> (eval *1)
> 6
>
> Does that mean that functions evaluate to themselves?
>
Sure, they always have (think map). The trick is, what happens when
you embed them in code, as the above does, or some macros would like
to do. In the early work towards AOT I wasn't able to serialize fns,
such serialization being necessary for putting constants in to
bytecode. I've relaxed that restriction for fns that are not closures
- they are now print-dup'able.
Rich
>
> On Nov 19, 9:01 am, "J. McConnell" <[EMAIL PROTECTED]> wrote:
>
> > In writing up tests for clojure.contrib.test-clojure that cover the
> > Evaluation page of clojure.org, I came across the fact that the
> > following threw a CompilerException due to a
> > "java.lang.ClassNotFoundException: clojure._PLUS___224":
>
> > (eval (eval '(list + 1 2 3)))
>
> > After the AOT changes, this no longer throws an exception and instead
> > produces what I had expected previously, the value 6. Is this
> > something that will be supported now, i.e. should I be testing to
> > ensure that the above form produces 6? My suspicion is yes, but I
> > wanted to check anyhow.
>
> > Thanks,
>
> > - J.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---