On Sat, Mar 12, 2011 at 10:44 AM, Stuart Sierra
wrote:
>> Yes, but "create a static final member in the class I'm generating
>> bytecode for, stuff the object in that static member, and embed a
>> reference to the static member here" seems like a sensible thing for
>> it to do.
>
> That's easy for
>
> Yes, but "create a static final member in the class I'm generating
> bytecode for, stuff the object in that static member, and embed a
> reference to the static member here" seems like a sensible thing for
> it to do.
>
That's easy for simple types like java.util.Date, but how could it work f
On Fri, Mar 11, 2011 at 11:52 PM, Stuart Sierra
wrote:
> `eval` invokes the Clojure compiler, which transforms data structures into
> Java bytecode. The Clojure compiler understands Clojure data structures
> like lists, vectors, and symbols, plus a few Java types like String and
> numbers. It do
On Fri, Mar 11, 2011 at 11:12 PM, Armando Blancas
wrote:
> You need to quote the vector so the date will be created inside eval,
> instead of having the date go into eval as an element of the
> (evaluated) vector.
A more interesting question is "why does this error exist in the first
place"? Why
`eval` invokes the Clojure compiler, which transforms data structures into
Java bytecode. The Clojure compiler understands Clojure data structures
like lists, vectors, and symbols, plus a few Java types like String and
numbers. It doesn't know what to do with a java.util.Date. "Can't embed
o
What does eval'ing a form containing an object reference cause an
exception? What am I doing wrong?
user=> (eval [(java.util.Date.)])
java.lang.RuntimeException: Can't embed object in code, maybe print-dup not
defined: Fri Mar 11 19:33:04 EST 2011 (NO_SOURCE_FILE:153)
This is the simplest exam
You need to quote the vector so the date will be created inside eval,
instead of having the date go into eval as an element of the
(evaluated) vector.
user=> (eval '[(java.util.Date.)])
[#]
On Mar 11, 4:37 pm, Jeffrey Schwab wrote:
> What does eval'ing a form containing an object reference cause