Guys,

I've searched the group and cannot find an answer to this one...

Why are many of the more common collection types in Clojure not
Serializable :

Clojure 1.1.0-new-SNAPSHOT
user=> (def #^java.io.ObjectOutput os (java.io.ObjectOutputStream.
(java.io.FileOutputStream. "/dev/null")))
#'user/os
user=> (.writeObject os [1 2 3 4])
java.io.NotSerializableException: clojure.lang.PersistentVector$Node
(NO_SOURCE_FILE:0)
user=> (.writeObject os (list 1 2 3 4))
java.io.NotSerializableException: clojure.lang.PersistentList
(NO_SOURCE_FILE:0)
user=> (.writeObject os #{1 2 3 4})
java.io.NotSerializableException: clojure.lang.PersistentHashMap
$BitmapIndexedNode (NO_SOURCE_FILE:0)
user=> (.writeObject os {:1 2 :3 4})
nil
user=>

I am writing a distributed Java/Clojure app and am constantly bitten
by this. I am always having to copy collections into ArrayLists before
sending them, from Java code, over the wire...

ArrayLists, however do not implement Comparable and I now need a
Comparable AND Serializable collection. :-(

Is there a wishlist for Clojure 1.2 ? :-)

Is there a good reason why making '(), [], {} and #{} Serializable
should not be on it ?

thanks


Jules

P.S.

I'm using 1.1.0-new-SNAPSHOT - is there another version that
implements this, hence the lack of noise on the list ?

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