I wrote a JSON encoder/decoder for Rebol 2. I'm rewriting it for Rebol 3 and would prefer to make it available in Rebol 3 as a codec:
load %data.json
save %data.json object
decode 'json to-binary {["some","json"]}
How should I go about this?
At the time of asking, documentation on this subject is scarce.
The simple answer is that you can't. As for why, there are several answers to that.
encode
only takes images, binaries or strings. Maybe just having a decoder is enough for you though.parse
. Do you have a native code version of your parser?I wish there was a better answer to your question right now.
Codecs were imo in highly non-finished state. I proposed some kind of streamed mechanism was needed, IIRC Carl understood the need, but the solution was never imo outlined. Ditto for tasks - current "implementation" is far from what Carl envisioned for R3 tasking ...
There is a tool, read this: http://rebol2.blogspot.it/2012/12/json.html
and this: http://www.rebol.com/article/0522.html
However json is a complex way to handle data, rebol block is perfect in my humble opinion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With