Hi Philippe,
There is Magritte-Json in [1]. It gives you more control, you can
override the name of a property and choose not to
serialize certain
objects. I found this necessary when implementing certain predefined
APIs. It's a bit more "magritty" in the sense that is uses reader and
writer objects. Though it could certainly be improved on. You can find
examples in [2].
[1]
http://source.lukas-renggli.ch/magritteaddons
[2]
http://www.squeaksource.com/orion
It looks good and more comprehensive than my effort.
It appears that objects have to be derived from MJObject in order to use the
Json conversion. Would there be a problem moving the #javascriptOn: method
from MJObject to an extension method on GRObject to allow more objects to
gain the Json conversion functionality? (I choose GRObject as WAObject,
PRObject & MAObject are all ultimately derived from GRObject).
The difference between #asJavascript (with it's
accompanying #javascriptOn:), asJson (with it's accompanying #jsonOn:)? It
appears that even though #asJavascript and #asJson have largely the same
effect, #asJson implements a Json compatible subset of #asJavascript. Would
it not make sense to use #asJson instead of #asJavascript and #jsonOn:
rather than #javascriptOn:, or have I missed something?
Cheers
Nick