Re: [Cbor] extensible enumerations, ignoring unknown values in CDDL

Carsten Bormann <cabo@tzi.org> Sun, 14 April 2024 16:00 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4BA7EC14F689 for <cbor@ietfa.amsl.com>; Sun, 14 Apr 2024 09:00:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.888
X-Spam-Level:
X-Spam-Status: No, score=-6.888 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01] autolearn=ham autolearn_force=no
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 TEiidbrW2WM8 for <cbor@ietfa.amsl.com>; Sun, 14 Apr 2024 09:00:38 -0700 (PDT)
Received: from smtp.zfn.uni-bremen.de (smtp.zfn.uni-bremen.de [IPv6:2001:638:708:32::21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 C3208C14F5F4 for <cbor@ietf.org>; Sun, 14 Apr 2024 09:00:36 -0700 (PDT)
Received: from eduroam-pool10-144.wlan.uni-bremen.de (eduroam-pool10-144.wlan.uni-bremen.de [134.102.90.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4VHZlN2vGhzDCd9; Sun, 14 Apr 2024 18:00:32 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <CAKoiRuY3XYi=Aefdp_hGVEiKWxw8W_YN-UOaY62V2s9hUA8DZw@mail.gmail.com>
Date: Sun, 14 Apr 2024 18:00:31 +0200
Cc: cbor@ietf.org
X-Mao-Original-Outgoing-Id: 734803231.451103-8dce72a7c5d670f007b29dff5cdc81c7
Content-Transfer-Encoding: quoted-printable
Message-Id: <768E4D65-D842-4DAF-ABCD-02534E69B8D1@tzi.org>
References: <CAKoiRua7YXqw4T2zOfoQG7LkaUZ6he1jTsniWC0EPFnunsSzkw@mail.gmail.com> <0966BC9D-70A3-4C48-A719-81D2B3771EAB@tzi.org> <CAKoiRuY3XYi=Aefdp_hGVEiKWxw8W_YN-UOaY62V2s9hUA8DZw@mail.gmail.com>
To: Rohan Mahy <rohan.mahy@gmail.com>
X-Mailer: Apple Mail (2.3608.120.23.2.7)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/cwTwwvIbt-Y8y3yN3CSLbCEF0fc>
Subject: Re: [Cbor] extensible enumerations, ignoring unknown values in CDDL
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 14 Apr 2024 16:00:44 -0000

On 2024-04-14, at 17:40, Rohan Mahy <rohan.mahy@gmail.com> wrote:
> 
> Thanks Carsten,
> How about the following:
> 
> disposition = ( std_dispos // $$ext_dispos // unknown_dispos )

There is a little details here: The value choices are CDDL *types*, so you would be using a single slash for the choices and a single dollar for the socket.

(Underscore ➔ dash?)

I would also throw the std-dispos into $$ext_dispos, but that is a matter of style.

> std-dispos = &(

(The name “std” tells me that document 1 and document 2 below will not be standards.  If that is not what you mean, I’d call it something like “basic”.)

>     unspecified: 0,
>     render: 1,
>     reaction: 2,
>     profile: 3,
>     inline: 4,
>     icon: 5,
>     attachment: 6,
>     session: 7,
>     preview: 8
> )
> unknown_dispos = &( unknown: 8..255 ) ; Note: any ext_dispos take precedence
> 
> Then later document 1 could add
> 
> $$ext_dispos //= &(
>     background: 9,
>     mood: 10
> )
> 
> And later document 2 could add
> 
> $$ext_dispos //= &(
>     playlist: 11,
>     game: 10
> )

Grüße, Carsten