taoensso / nippy

The fastest serialization library for Clojure
https://www.taoensso.com/nippy
Eclipse Public License 1.0
1.04k stars 60 forks source link

Support deftypes #58

Closed optevo closed 8 years ago

optevo commented 9 years ago

Hi,

Is it possible to add support for deftyped classes? I can see you've left a data type id for them commented out. :) Looking at the class a deftype generates, it implements IType, a single constructor for all fields and a static method "getBasis" which defines the field order for the constructor so it should be possible to use reflection to read/create. I suppose I could use this to make a macro to generate the extend-freeze/extend-thaw but it would be handy to have fallback to runtime support for types that I haven't created a custom (de)serializer for (at least as an option).

ptaoussanis commented 9 years ago

Hi Richard, had plans to explore adding this but never got around to it (and won't have the time soon, unfortunately).

Would be very happy to see a PR that adds deftype serialization and the corresponding unit tests.

Cheers! :-)

ptaoussanis commented 8 years ago

Moving to #83