3 ms·
<redacted> I'll stick with JSON for one simple reason: you can have anything as a key (as long as it's escaped). The fact that this can't means you either a)
by Groxx 14y ago
<redacted>
I'll stick with JSON for one simple reason: you can have anything as a key (as long as it's escaped). The fact that this can't means you either a) can't use it if you have more-complex keys for some reason, or b) you have to use some non-standardized packing format to encode your illegal keys.
</redacted>
edit: thanks repliers, I missed part of the spec. Ignore!
- lmkg 14y agoFalse. You can use anything as a key. > Note that keys and values can be elements of any type. The sample code also uses a vector as a key.
- Groxx 14y agoAh, I missed that part. I was going off the keyword == symbol rules, which are waaaaay more restrictive. Thanks!
- andrewflnr 14y agoDid you read the spec? "... keys and values can be elements of any type".
- zcam 14y agoWell if by anything you mean Strings, that is very limited. 2.2. Objects An object structure is represented as a pair of curly brackets surrounding zero or more name/value pairs (or members). A name is a string. A single colon comes after each name, separating the name from the value. A single comma separates a value from a following name. The names within an object SHOULD be unique. http://www.ietf.org/rfc/rfc4627.txt http://www.ietf.org/rfc/rfc4627.txt