4 ms·
You're correct, the major disadvantage here is the ambiguity not just in this JSON/S-expression translation but in any possible JSON/S-expression translation. L
by qntm 15y ago
You're correct, the major disadvantage here is the ambiguity not just in this JSON/S-expression translation but in any possible JSON/S-expression translation. Linear arrays and key-value dictionaries in most programming languages are intuitive and meaningful and usually even have a native data type. The conversion is usually very obvious. Not so much with S-expressions.
An even simpler problem is how do you express an empty array and an empty object in S-expressions? Is it () for both?
EDIT: and what about nulls? What about strings that resemble numbers?
- buddydvd 15y agoYes, there are certainly more problems. I think the reason why the author thought S-expressions are more compact is because the comparison was made between formatted versions of the expressions (how they would appear in code): ["a", "b", "c"] ("a" "b" "c") Since people generally put spaces after their commas.