3 ms·
You could do make it more like S-expressions in JS if you really wanted. {object: [ {id: "1234"}, {isEnabled: "true"}, {props: ["abc", "1
by zyxley 10y ago
You could do make it more like S-expressions in JS if you really wanted.
{object: [
{id: "1234"},
{isEnabled: "true"},
{props: ["abc", "123", "false"]}]}
Not quite the same, but nothing keeps you from parsing an array of key/value pairs instead of a hash.
- wtbob 10y agoYou may not leave JSON object properties unquoted, so it'd have to read: {"object": [ {"id": "1234"}, {"isEnabled": "true"}, {"props": ["abc", "123", "false"]}]} So you have extraneous quotes, extraneous semicolons, extraneous commas, plus the parsing code is complicated by having to handle all of that rather than atoms & lists (that's not a strong reason, since parsing code is written once and used millions of times). I really, really don't get the visceral opposition to S-expressions. From my perspective they're both better & simpler.