data.fressian

add clojure.lang.PersistentVector encoding/decoding

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test

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.

Activity

Hide
Stuart Halloway added a comment -

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
Show
Stuart Halloway added a comment - 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
Hide
Stuart Halloway added a comment -

Needs Fressian enhancement instead.

Show
Stuart Halloway added a comment - Needs Fressian enhancement instead.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: