Re: [Cbor] 7049bis: The concept of "optional tagging" is not really used in practice #126

Carsten Bormann <cabo@tzi.org> Mon, 04 November 2019 16:34 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 2624B120232 for <cbor@ietfa.amsl.com>; Mon, 4 Nov 2019 08:34:22 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.199
X-Spam-Level:
X-Spam-Status: No, score=-4.199 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NRFvP4_iEUav for <cbor@ietfa.amsl.com>; Mon, 4 Nov 2019 08:34:20 -0800 (PST)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1588E12011F for <cbor@ietf.org>; Mon, 4 Nov 2019 08:34:20 -0800 (PST)
Received: from [192.168.217.102] (p548DC893.dip0.t-ipconnect.de [84.141.200.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 476JKQ1vRRzyjS; Mon, 4 Nov 2019 17:34:18 +0100 (CET)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <3F9E4E02-7A86-4954-8E31-0E28D2B2FCDA@island-resort.com>
Date: Mon, 04 Nov 2019 17:34:17 +0100
Cc: cbor@ietf.org, Christophe Lohr <christophe.lohr@imt-atlantique.fr>
X-Mao-Original-Outgoing-Id: 594578055.681186-09573d8762d033e2facc76f92b42e5fb
Content-Transfer-Encoding: quoted-printable
Message-Id: <E7C97A51-BE67-4752-ADE6-A985E0B8A7AF@tzi.org>
References: <92400DAA-A713-4905-A721-34B138E25192@tzi.org> <ed45e995-1858-3169-1be6-0cce5ce37ce3@imt-atlantique.fr> <87889E65-0152-455A-A6B7-C5F336DC97A4@island-resort.com> <CBC1EF6C-FAF5-4AC9-B0DC-C3FD2ED8B88D@tzi.org> <8B119642-7D8D-4BEF-AD75-0AC9935BCD7C@island-resort.com> <B86EE13B-12C9-4918-8BE9-5E4BEBF3B779@tzi.org> <3F9E4E02-7A86-4954-8E31-0E28D2B2FCDA@island-resort.com>
To: Laurence Lundblade <lgl@island-resort.com>
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/S1H5jY-xzXFBgw2BlwMOXJ8ycK8>
Subject: Re: [Cbor] 7049bis: The concept of "optional tagging" is not really used in practice #126
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
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: Mon, 04 Nov 2019 16:34:22 -0000

On Nov 4, 2019, at 17:28, Laurence Lundblade <lgl@island-resort.com> wrote:
> 
> Was thinking more like COSE:
> 
> decfrac = [
>               e10: int,
>               m: integer
>            ]
> 
> decfrac_tagged = #6.4(decfrac)

That kind of style was written when we didn’t have the unwrap operator.

RFC 8610 says:

                  decfrac = #6.4([e10: int, m: integer])

Which is exactly what is called “decfrac_tagged” in the above.
If you don’t want the tag, just write ~decfrac, and you have what you called decfrac in your example.

(And the fact that the unwrap convention works universally obviates the need to come up with noisy conventions such as _tagged.)

> That way you can say exactly which you want in CDDL without constructing the CDDL for the non-tagged form. Will also help make it clear that  protocol designers need to be clear and pick one.
> 
> Maybe even ask that every new registered data type have CDDL like this published suitable for normative reference as a requirement for getting into the IANA registry?

Requiring this would create too much coupling.
Suggesting this is a good job for the DE :-)

(“suitable for normative reference” is a different issue, though.)

Grüße, Carsten