I have a record like this:
and I would like to make it serializable, like this:
(extend-msgpack
Foo
21
[v] (msgpack/pack (into {} v))
[bytes] (map->Foo (msgpack/unpack bytes)))
However, this causes undefined behavior because a Foo record is also an IPersistentMap. Sometimes the record gets serialized correctly, sometimes it gets serialized as a simple map.
What's the best solution to this problem?