JSON: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 304:
>>> data
{'foo': 1, 'bar': [10, 'apples']}</lang>
 
=={{header|REBOL}}==
Using [http://www.json.org/json.r json.org/json.r]
 
<lang rebol>json-str: {{"menu": {
"id": "file",
"string": "File:",
"number": -3,
"boolean": true,
"boolean2": false,
"null": null,
"array": [1, 0.13, null, true, false, "\t\r\n"],
"empty-string": ""
}
}}
 
res: json-to-rebol json-str
js: rebol-to-json res
</lang>
 
json-to-rebol Result:
 
<pre>
make object! [
menu: make object! [
id: "file"
string: "File:"
number: -3
boolean: true
boolean2: false
null: none
array: [1 0.13 none true false "^-^M^/"]
empty-string: ""
]
]
</pre>
 
 
rebol-to-json Result:
 
<pre>
{
"menu": {
"id": "file",
"string": "File:",
"number": -3,
"boolean": true,
"boolean2": false,
"null": null,
"array": [1, 0.13, null, true, false, "\t\r\n"],
"empty-string": ""
}
}
</pre>
 
=={{header|Ruby}}==
31

edits