[Jsonpath] On @index and similar

Daniel P <danielaparker@gmail.com> Tue, 26 April 2022 13:33 UTC

Return-Path: <danielaparker@gmail.com>
X-Original-To: jsonpath@ietfa.amsl.com
Delivered-To: jsonpath@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DDBADC06FA8C for <jsonpath@ietfa.amsl.com>; Tue, 26 Apr 2022 06:33:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.199
X-Spam-Level:
X-Spam-Status: No, score=-0.199 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IAOI9EgmU-NE for <jsonpath@ietfa.amsl.com>; Tue, 26 Apr 2022 06:33:48 -0700 (PDT)
Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8D5CBC07395C for <jsonpath@ietf.org>; Tue, 26 Apr 2022 06:33:48 -0700 (PDT)
Received: by mail-pl1-x62a.google.com with SMTP id p6so2316716plf.9 for <jsonpath@ietf.org>; Tue, 26 Apr 2022 06:33:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=SvSAToIjlF7WlkmCzR2a1up/TgFAxDSNbK9l4IXvC3Y=; b=nQs68tBOxJvU0GIndORn0nY1WZac2jIXbBABqTRfb/E7EUcXW3m7fjUOrfucVR/v48 TfgoiNsOmYkq8onIYAnm1S3WrXjdDNax5G0yW/3ADkMDEIsSu0YrlCf4iiLJI95lt6OU WTDG2RILio0UYUZ1grTbzu3//tlERe8RqLD/GsDrODFP6rvOHOVR26yF6lTYYuQib/wO 74lHVAHgGc2eMrYbXBAO63PXcLpYx7bnDEeBUvWugQEunXBLzTWQQlxqwvYNuq3x5l1k fViCmGPX6+Iq4H2VnQ6qjQ7n23UXa5JSGVR8xelJe4vrLJbLy9hn4hItVXdboSOEIn7U sjzw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=SvSAToIjlF7WlkmCzR2a1up/TgFAxDSNbK9l4IXvC3Y=; b=lSHi+W9E65azNWsqheSZwN0gyysVitRRbbuGb5GD8hUwRVg+pI7whwzWtsXN+Jglgi BRavPZvhi6CLSyzAVyzTo1u3zmYl7SHPkNUqBZKq/JLkmb1g2eDsxKvexw5/mQB6YAW6 Q1rganGKXevAyce0gb/gq0sAOSCHCPSPJhUoUaX8uu83aIlpCMUyvWNTTnR9sKgjum1S rc5uXLIYOhg2FGSuAa3tInLoukw9oKesEpXBzEbFkUMCCyMGLSIReJWJHYsibzgl3QP/ 85mMIRAwd9Y0UdqT+xGD+IT3147hcupGyZXZZnNDrmA6e9MyYZt8Sqaz20Zr5boUINO7 iZzg==
X-Gm-Message-State: AOAM532szZ3LcrNpMRJQxvvgWd0pxEk7W8ZpV7sD9SXUEUI/tBFvnW2s u9u6xXN5zN8eZHDRX3mELKpLkjEVrudvK0ihloOIBGbig2M=
X-Google-Smtp-Source: ABdhPJxzJkm00j3InyMmFiwt6UDXDP53MQ+9YReCaqzv2UykMyou9LKpen4eInTf/5nNu7ygOJ6Z16yUHczHziTRMmE=
X-Received: by 2002:a17:903:1251:b0:156:9d8e:1077 with SMTP id u17-20020a170903125100b001569d8e1077mr23103958plh.116.1650980027525; Tue, 26 Apr 2022 06:33:47 -0700 (PDT)
MIME-Version: 1.0
References: <mailman.110.1650927448.28781.jsonpath@ietf.org>
In-Reply-To: <mailman.110.1650927448.28781.jsonpath@ietf.org>
From: Daniel P <danielaparker@gmail.com>
Date: Tue, 26 Apr 2022 09:33:35 -0400
Message-ID: <CA+mwktLr2SpcAPiMa9GXjb=AhJ=H3f65aULCxzeNm+U6i_qD9w@mail.gmail.com>
To: jsonpath@ietf.org
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/KvZH7KMOuhXj_xGoNWLEWXdwsiE>
Subject: [Jsonpath] On @index and similar
X-BeenThere: jsonpath@ietf.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: A summary description of the list to be included in the table on this page <jsonpath.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jsonpath>, <mailto:jsonpath-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jsonpath/>
List-Post: <mailto:jsonpath@ietf.org>
List-Help: <mailto:jsonpath-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jsonpath>, <mailto:jsonpath-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Apr 2022 13:33:49 -0000

> From: Greg Dennis <gregsdennis@yahoo.com>

> I think @foo is too similar to @.foo and will cause problems for human readers.
>
> Regarding functions, I think this syntax will back us into a corner where we can't support a function that takes a parameter, should someone want that sort of thing.
>
> Additionally, how would you get the length of a nested array, e.g. @.foo.length where @.foo is an array?  You really need the traditional function syntax to do this: length(@.foo).
>

Agreed on the unsightliness (and unnecessity, and ad hockery) of the
@foo notation.  Prior experience suggests just going with function
syntax. @index sounds a lot like the XPath fn:position() function, why
not do something similar?

Daniel