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

Martin Thomson <martin.thomson@gmail.com> Mon, 17 December 2012 21:31 UTC

Return-Path: <martin.thomson@gmail.com>
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 AEEAE21F886F for <ietf@ietfa.amsl.com>; Mon, 17 Dec 2012 13:31:22 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.918
X-Spam-Level:
X-Spam-Status: No, score=-4.918 tagged_above=-999 required=5 tests=[AWL=-1.319, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
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 HFtm-UqY2Qdm for <ietf@ietfa.amsl.com>; Mon, 17 Dec 2012 13:31:22 -0800 (PST)
Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) by ietfa.amsl.com (Postfix) with ESMTP id E6D3121F879A for <ietf@ietf.org>; Mon, 17 Dec 2012 13:31:21 -0800 (PST)
Received: by mail-lb0-f172.google.com with SMTP id y2so37960lbk.31 for <ietf@ietf.org>; Mon, 17 Dec 2012 13:31:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ousvSUnx9p5KY66Rw1NW6nTmPN3tIwKWofQ+KfbKNaU=; b=x3hfzB6ULbLs3sDxB6JYqJWjVT4/0yduTKt2IyY7rsuPGfVYrsSZnGqoE+JiuasU4T L5flVMQdSDpNXvKYWQ6oxdN86f5wabwF86vsP3HxPrVRRJTVgWBZlgWyvFfl5Zlh/N9v 3ITMuffmLD+4vxp+GuI8X0GJdx4CuH+qCreGboGi3ghSwFrFb1kl7tAfK0Y7sCWMIyST td0foyDUeV8z2OYN0NF17JiqYpenM8+Nl2548ZHuxqd+L5ZBZYpw5RLG/rpV6bK7zr2K l1beluzeIqgLT7NYcpJ893q1GLu0jN0mUEI1z3uyB1UTFkmRX3MqedTUIZ1JgG1msVRd 6ScA==
MIME-Version: 1.0
Received: by 10.152.106.212 with SMTP id gw20mr12501178lab.8.1355779880815; Mon, 17 Dec 2012 13:31:20 -0800 (PST)
Received: by 10.112.98.200 with HTTP; Mon, 17 Dec 2012 13:31:20 -0800 (PST)
In-Reply-To: <CAC4RtVDaxJRXw-LkEfot6gkJyDY9ncRdc9oD8WdNwMsi+20nQw@mail.gmail.com>
References: <6B4F2945-EC54-4171-92FF-3A88CEB27D23@mnot.net> <p1txrkkc9p.fsf@d72933.na.sas.com> <CAC4RtVDaxJRXw-LkEfot6gkJyDY9ncRdc9oD8WdNwMsi+20nQw@mail.gmail.com>
Date: Mon, 17 Dec 2012 13:31:20 -0800
Message-ID: <CABkgnnUvu2ikiKvgP90Uro2BTaM2XzZSHNPmpRKaJiqoLj_qBg@mail.gmail.com>
Subject: Re: draft-ietf-appsawg-json-pointer-07 - array index for end ofarray
From: Martin Thomson <martin.thomson@gmail.com>
To: Barry Leiba <barryleiba@computer.org>
Content-Type: text/plain; charset="UTF-8"
Cc: Mark Nottingham <mnot@mnot.net>, "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: Mon, 17 Dec 2012 21:31:22 -0000

On 17 December 2012 11:54, Barry Leiba <barryleiba@computer.org> wrote:
>> 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.

This is true, it does sound compelling.

There will, no doubt, be questions about why -2 doesn't work.  It's
tempting to implement -2 and -3, so you might have to explain why that
is a bad idea.

index = (index + length) % length