couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Davis" <>
Subject Re: partial/diff updates?
Date Fri, 28 Nov 2008 06:32:16 GMT
On Fri, Nov 28, 2008 at 12:13 AM, Antony Blakey <> wrote:
> On 28/11/2008, at 4:08 PM, Paul Davis wrote:
>> Any JSON diff format is going to require the JSON RFC's 'SHOULD' to
>> either be changed to a 'MAY' or 'MUST'. The ambiguity in 'SHOULD' is
>> going to cause problems.
> That "SHOULD" is dominated by the preceding statement that "A JSON text is a
> serialized object or array", so it is effectively a "MUST" because the spec
> doesn't allow for any other possibility. IMO the JSON spec is not ambiguous
> in respect of this issue.

I fail to see how "A JSON text is a serialized object or array" in any
way dictates that object member names must be unique. Obviously to see
such an interpretation we have to ignore 99% of the current JSON
implementations that assume JSON object member names are unique, but
still, a strict reading of the spec allows non unique member names.
And as I said, the current JSON dserializer that couchdb uses allows
for non-unique member names (but only ever operates on the first).

>> Or we could use a array[-1] syntax like some languages.
> For sure. My point is that a JSON-community driven diff might presume that
> Javascript expressions (as in JSONPath) are OK, and hence assume you would
> use "@.length - 1". The context of the JSON community is not necessarily
> Couch's context.

Here we're totally in agreement. We should yell and scream at the JSON
community for being shortsighted int their ideas of requiring a full
JavaScript engine to evaluate their RFC's. That's not to say we don't
want them on our side though. Perhaps it should be more of a subtle
coup d'├ętat in how we approach making a diff spec.

> Antony Blakey
> -------------
> CTO, Linkuistics Pty Ltd
> Ph: 0438 840 787
> There is nothing more difficult to plan, more doubtful of success, nor more
> dangerous to manage than the creation of a new order of things... Whenever
> his enemies have the ability to attack the innovator, they do so with the
> passion of partisans, while the others defend him sluggishly, So that the
> innovator and his party alike are vulnerable.
>  -- Niccolo Machiavelli, 1513, The Prince.

View raw message