Re: draft-ietf-appsawg-json-pointer-07 - array index for end ofarray

Mark Nottingham <mnot@mnot.net> Tue, 18 December 2012 00:36 UTC

Return-Path: <mnot@mnot.net>
X-Original-To: ietf@ietfa.amsl.com
Delivered-To: ietf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2AAA021E8039 for <ietf@ietfa.amsl.com>; Mon, 17 Dec 2012 16:36:39 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -103.732
X-Spam-Level:
X-Spam-Status: No, score=-103.732 tagged_above=-999 required=5 tests=[AWL=-1.133, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4dC7j4egqS2q for <ietf@ietfa.amsl.com>; Mon, 17 Dec 2012 16:36:35 -0800 (PST)
Received: from mxout-08.mxes.net (mxout-08.mxes.net [216.86.168.183]) by ietfa.amsl.com (Postfix) with ESMTP id E3A8D21E802E for <ietf@ietf.org>; Mon, 17 Dec 2012 16:36:34 -0800 (PST)
Received: from [192.168.1.80] (unknown [118.209.33.170]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id F15C2509B6; Mon, 17 Dec 2012 19:36:32 -0500 (EST)
Content-Type: text/plain; charset="iso-8859-1"
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
Subject: Re: draft-ietf-appsawg-json-pointer-07 - array index for end ofarray
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <CAC4RtVDaxJRXw-LkEfot6gkJyDY9ncRdc9oD8WdNwMsi+20nQw@mail.gmail.com>
Date: Tue, 18 Dec 2012 11:36:28 +1100
Content-Transfer-Encoding: quoted-printable
Message-Id: <F341FF15-EE2B-4D36-A484-1D44FB7D16F4@mnot.net>
References: <6B4F2945-EC54-4171-92FF-3A88CEB27D23@mnot.net> <p1txrkkc9p.fsf@d72933.na.sas.com> <CAC4RtVDaxJRXw-LkEfot6gkJyDY9ncRdc9oD8WdNwMsi+20nQw@mail.gmail.com>
To: Barry Leiba <barryleiba@computer.org>
X-Mailer: Apple Mail (2.1499)
Cc: "David J. Biesack" <David.Biesack@sas.com>, IETF discussion list <ietf@ietf.org>
X-BeenThere: ietf@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: IETF-Discussion <ietf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf>, <mailto:ietf-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ietf>
List-Post: <mailto:ietf@ietf.org>
List-Help: <mailto:ietf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf>, <mailto:ietf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 18 Dec 2012 00:36:39 -0000

I disagree. Adding a capability for other indices down the road is NOT compatible for existing uses, so adding it will cause confusion ("are you using the old JSON Pointer or the new one?") and interop problems.

IIRC the discussion in the WG went much along these lines, and led to us explicitly choosing a single character, rather than a misleading "-1" construct. I'd be more comfortable with changing the character to something even further away, rather than making this construct even more confusing. 

The other way we could go would be to do full negative indexing; we don't have any use cases for that, and it increases complexity a bit, but at least it would be unsurprising.


On 18/12/2012, at 6:54 AM, Barry Leiba <barryleiba@computer.org> wrote:

>>> This was discussed in the Working Group, but it wasn't felt that the added
>>> complexity was worth it; there's a strong feeling that this spec should be as
>>> simple as possible.
>> 
>> Might I suggest, however, using -1 instead of "-" to refer to the last item in an
>> array, as this provides two benefits:
>> 
>> 1) Allows for adding the complexity down the road in a compatible way, should
>>   there be need
>> 2) Uniformity; i.e. always using integer values for referring to array elements.
> 
> I have to say that this suggestion sounds very compelling to me, for
> both reasons.  I know there's a bunch of running code out there, but
> this (and perhaps teasing apart the "add" and "insert" concepts into
> separate verbs) seems worth the bother.
> 
> Barry, as participant

--
Mark Nottingham   http://www.mnot.net/