[Seaside-dev] WAJsonParser: crossplatform readStream questions

Diego Lont diego.lont at delware.nl
Wed Feb 26 10:36:43 UTC 2014


Hi all,

Nice to see that more people are working on json at the moment. I currently am working on it to move my data from pharo to gemstone, using magritte json. As Gemstone does not have a String readStream implementation, I decided to take a better look into the parsing done by seaside: and I refactored this a bit, so it only uses the core streaming methods ( peek, next, next: ) and no longer requires the stream to be positionable. I checked the tests: and they are all green, so I committed this change.

Note that I assume that "next: anInteger” conforms to the “c” standard. It returns the next … characters, and if not available a shorter string. If this is not the case, it will cause that on invalid json a different error may be thrown than a WAJsonSyntaxError. Is this a problem for other platforms? And if this is a problem, do you have suggestions how to solve this cross-platform?

Next step is that I add a readstreamFromString: method to grease, since I have to read my json from a string, and the seaside UI only allows me to read it from a stream.
- The pharo implementation will be easy: “^aString readStream”
- I guess I will need to add a basic stream to Gemstone that allows me to “stream” a string. If someone knows a better (easier) solution: let me know.

Cheers,
Diego


More information about the seaside-dev mailing list