couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Blakey <>
Subject Re: Document Updates
Date Fri, 14 Nov 2008 02:52:58 GMT

On 14/11/2008, at 1:04 PM, Paul Davis wrote:

> I don't think we need canonical JSON.
> The Spec definitely needs to be disambiguated though. As I see it
> there are two interpretations:
> 1. Order of fields matters which means repeated fields are ok
> 2. Order does not matter which means repeated fields are NOT ok

Given that JSON is executable Javascript, 2 is the only interpretation  
that allows for roundtrip equivalence.

> Not sure if it's obvious or not, but switching from case 2 to 1 is
> straightforward. Also, my current array diff implementation is kinda
> whack. And indels screw the rest of the diff, as in, its not so much a
> diff as a delete rest and add new. Getting this optimal is actually an
> N^2 runtime algorithm via dynamic programming (smith-waterman style)

The algorithm described here: 
  is O(n), and although it isn't optimal, I'm guessing the performance  
stability makes up for it.

Antony Blakey
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

Did you hear about the Buddhist who refused Novocain during a root  
His goal: transcend dental medication.

View raw message