3 ms·
The more you try and push JSON along these lines the more it ends up looking like Rebol. Here are the examples in Rebol: [ ; comments ;; specify
by draegtun 12y ago
The more you try and push JSON along these lines the more it ends up looking like Rebol.
Here are the examples in Rebol:
[
; comments
;; specify rate in requests/second
rate: 1000
; quoting
key: 'value
text: "Look ma, some quotes!"
; path & HTML
path: %\c\windows
inject: <div class="important"></div>
; no need for escapes
space: %\c\windows\foo%20bar.txt
space2: %"\c\windows\foo bar.txt"
; no commas
one: 1
two: 2
; multiline string
haiku: {
Line 1
Line 2
Line 3
}
; array/list/block
fav-numbers: [1 2 3 6 42]
; and finally...
name: 'hjson
desc: "Rebol data format"
main: %./lib/rebol.reb
version: 1.0.1
tags: [
json
hjson
rebol
]
; and really finally...
light-switch: on
useful: yes
boolean: true
co-ords: 10x100
ip: 192.168.100.1
date: 1-Jan-1970
]
Of course this shouldn't be a surprise because Douglas Crockford cites Rebol as an influence on JSON.
For those interested have a look at REN (REadable Notation), a subset/dialect of Rebol, which is an attempt to produce a standardised format - https://github.com/humanistic/REN https://github.com/humanistic/REN