<< Back to previous view

[DFRS-1] add clojure.lang.PersistentVector encoding/decoding Created: 03/Dec/13  Updated: 29/Jul/14  Resolved: 29/Jul/14

Status: Closed
Project: data.fressian
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Max Countryman Assignee: Stuart Halloway
Resolution: Declined Votes: 0
Labels: None

Attachments: Text File 0001-add-clojure.lang.PersistentVector-encoding-decoding.patch    
Patch: Code and Test


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.

Comment by Stuart Halloway [ 29/Jul/14 9:48 AM ]

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


  1. making the list extension point more feel like the other collection types for customization
Comment by Stuart Halloway [ 29/Jul/14 9:48 AM ]

Needs Fressian enhancement instead.

Generated at Tue Jan 23 18:14:02 CST 2018 using JIRA 4.4#649-r158309.