> On 26 May 2015, at 19:24, Esteban A. Maringolo <[email protected]> wrote:
> 
> It could be dead simple as specifying the class if the different JSON
> libraries shared a common to/from API selectors, but they don't.

Yes, it would be very good if there was such a thing as a common API for any 
reader/writer of any format (JSON, CSV, XML, STON, FUEL, ...).

For a reader that is pretty easy, I think. Any reader object should understand

 #readFrom: <stream> (binary or character ReadStream as appropriate)

And maybe also

 #readFromString: <string>
 #readFromBytes: <bytearray>

For the writer, I am not so sure. Maybe

 #nextPut: <object> toStream: <stream> (binary or character ReadStream as 
appropriate)

And maybe also

 #toString: <object>
 #toBytes: <object>

Note that the reader and writer objects could be different.

But like I said, I am not so sure about the API. We could try to define a Trait 
for this.

Sven


Reply via email to