add clojure.lang.PersistentVector encoding/decoding

Description

Previously, clojure.lang.PersistentVector was not special-cased on writing
and reading. This resulted in fressian-encoded streams, containing Clojure
vectors, being coerced on reads into java.lang.ArrayList. Coercion here is
a bit surprising and potentially causes unexpected errors.

Here we explicitly mark clojure.lang.PersistentVector instances with the
vec tag on writes and upon reads decode these back to Clojure's vector type
by casting them with a call to vec.

Environment

None

Activity

Show:
Stuart Halloway
July 29, 2014, 3:48 PM

The real problem here is that List extensibility is not exposed in Fressian itself. We would need to look into either

  1. user specified handlers where FressianReader calls getHandler

  2. documenting the ConvertList interface

or

  1. making the list extension point more feel like the other collection types for customization

Stuart Halloway
July 29, 2014, 3:48 PM

Needs Fressian enhancement instead.

Assignee

Stuart Halloway

Reporter

import

Labels

None

Approval

None

Patch

Code and Test

Priority

Major
Configure