4 ms·
This would completely break any event driven (streaming) parser.
by hosay123 13y ago
This would completely break any event driven (streaming) parser.
- the_gipsy 13y agoOr a parser that simply discards existing keys.
- IanCal 13y agoWhich, importantly, would be perfectly fine according to the spec (as I understand it).
- masklinn 13y agoIndeed, the spec states that keys SHOULD be unique (with RFC 2119 meaning) and leaves behavior unspecified in case of duplicate key.
- IanCal 13y agoMy favourite example of dealing with undefined behaviour is this: In practice, many C implementations recognize, for example, #pragma once as a rough equivalent of #include guards — but GCC 1.17, upon finding a #pragma directive, would instead attempt to launch commonly distributed Unix games such as NetHack and Rogue, or start Emacs running a simulation of the Towers of Hanoi.[7] Source: http://en.wikipedia.org/wiki/Undefined_behavior http://en.wikipedia.org/wiki/Undefined_behavior
- jgeerts 13y agoIt's overwriting existing keys, which is fine imo. When I use a map in any language and put a new value with a new key, expected behavior is that the previous key is overwritten.