I noticed the following behavior in Clojure 1.3 related to the new
object literal syntax [1]:

Clojure 1.3.0-master-SNAPSHOT
user=> (defrecord Foo [a b])
user.Foo
user=> (:a #user.Foo{:a 1 :b 2})
1
user=> #java.awt.Point[10 20]
#<Point java.awt.Point[x=10,y=20]>
user=> (.getX #java.awt.Point[10 20])
CompilerException java.lang.RuntimeException: Can't embed object in
code, maybe print-dup not defined: java.awt.Point[x=10,y=20],
compiling:(NO_SOURCE_PATH:10)

It seems that the Java literal object syntax can be embedded in larger
expressions for records but not for plain Java objects?

Truly, I don't know whether this was intended to work or not but I
thought I would mention it since I came across it.

Thanks.
-David

[1] - 
http://clojure02.managed.contegix.com/display/design/defrecord+improvements

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