swift-evolution at haravikk.me
Fri Apr 15 13:54:55 CDT 2016
> On 15 Apr 2016, at 16:48, John McCall via swift-evolution <swift-evolution at swift.org> wrote:
> The JSONValue type needs to be able to embed both JSON arrays and JSON objects,
Anyway, this is probably a reason why Swift dictionaries shouldn’t be used to implement a tree in this way, as they have no strict ordering, but the order of values in JSON is important, particularly when it comes to duplicate keys (the last always one takes precedence), and it’s technically okay to parse multiple duplicates values and combine them together if you want.
While the original post is an interesting way to define this structure, I think a specialised type is required to really capture this usefully.
More information about the swift-evolution