Re: [Cbor] Consolidated set of tags for map-like entities

Joe Hildebrand <hildjj@cursive.net> Mon, 15 March 2021 19:44 UTC

Return-Path: <hildjj@cursive.net>
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 7B98E3A0AD7 for <cbor@ietfa.amsl.com>; Mon, 15 Mar 2021 12:44:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.697
X-Spam-Level:
X-Spam-Status: No, score=-1.697 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=neutral reason="invalid (public key: not available)" header.d=cursive.net
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 0pGTbs5qIwfC for <cbor@ietfa.amsl.com>; Mon, 15 Mar 2021 12:44:27 -0700 (PDT)
Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 22BE53A0AD6 for <cbor@ietf.org>; Mon, 15 Mar 2021 12:44:27 -0700 (PDT)
Received: by mail-ot1-x32d.google.com with SMTP id o19-20020a9d22130000b02901bfa5b79e18so5722490ota.0 for <cbor@ietf.org>; Mon, 15 Mar 2021 12:44:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cursive.net; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=98LONevmsN+BrFZ6anq3VRfpEGKrcVQVTHeMk4deF6M=; b=rd4udYuuGY83LRrueTo6knVNYJk5pfErWHoQVDAslS38h21yi9MVTXDGP10Juu3ZDb 6intP/MddJD5s451RFyE+9FqEXzGM0Sri8mDw46aJHIvf0ONY0BY75nK8+ss6af1LLrE Qb9uVllwqWGejVR0EKJ17dAV3beYx1xyp26hE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=98LONevmsN+BrFZ6anq3VRfpEGKrcVQVTHeMk4deF6M=; b=P9zIzq/tbjWbakmBkpZYSbo//XSCTCX0+TiLXaHdYvQxlTgTIxtNKpEPz3Wlt3H3SN J/bUnOnre23giW8N4uxYXI9TiXxwiXLULCic2KBQJQYBy0VGcEvCFsecU7R4e+rzjk/M r3q8yxkxUvAOtYjaqKbgSo84gubPwb3m+A+aFtZrbuYzOBzMREB8YpdagfLZI4k5hz0Y 4H5Qd5uZyHgFp6fDDnoB6qzVwB/H1mS1pSBNHY7w/rLOiAO/d0y2QWTKi7WbYJN0SYvm SlzrhNJamT8RTHF1TjdTTIuuN4Co0OTMEnslLVfSUoFvhpj/ps1pxS3IdXrmYI54RZFv VjIQ==
X-Gm-Message-State: AOAM533bMVet1GfJPZGoXRTmM06v1tSMse2/rWW9a+QzkLpACI9n2aO/ u8twiSqDJL9obxUreOTakKEpIw==
X-Google-Smtp-Source: ABdhPJyzPV6YIi/6KFh3FaWYxHz/Qg1mkh1gWc/suCmpISYnM+fPn09kNv1qeMfmoMql7vpq27QhYA==
X-Received: by 2002:a05:6830:1282:: with SMTP id z2mr598169otp.30.1615837463938; Mon, 15 Mar 2021 12:44:23 -0700 (PDT)
Received: from ?IPv6:2601:282:200:3758:b10e:3847:34b3:46d6? ([2601:282:200:3758:b10e:3847:34b3:46d6]) by smtp.gmail.com with ESMTPSA id g2sm6792957otn.32.2021.03.15.12.44.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Mar 2021 12:44:23 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\))
From: Joe Hildebrand <hildjj@cursive.net>
In-Reply-To: <FA5E389C-C577-4D42-A19E-A3A50F14F730@tzi.org>
Date: Mon, 15 Mar 2021 13:44:22 -0600
Cc: Emile Cormier <emile.cormier.jr@gmail.com>, cbor@ietf.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <16642498-C82F-41CE-A06D-6C762AEEB6F9@cursive.net>
References: <CAM70yxC7o3CNz67Yx3-yLt3tPQaTRaezOO99Ssa-3ppu-NwD=Q@mail.gmail.com> <C2B0934A-2AAB-4A45-A354-407782B4CA0B@cursive.net> <FA5E389C-C577-4D42-A19E-A3A50F14F730@tzi.org>
To: Carsten Bormann <cabo@tzi.org>
X-Mailer: Apple Mail (2.3654.60.0.2.21)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/x5x3Th1s7Lu9TnNe-aC1wYOAKfw>
Subject: Re: [Cbor] Consolidated set of tags for map-like entities
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, 15 Mar 2021 19:44:28 -0000

> On Mar 15, 2021, at 12:51 PM, Carsten Bormann <cabo@tzi.org> wrote:
> 
> On 2021-03-15, at 19:50, Joe Hildebrand <hildjj@cursive.net> wrote:
>> 
>> Data Item being major type 5 should really only be used if the keys are homogeneously strings, in my opinion.
> 
> We are using a lot of integer labels with mt5, so why would we make that restriction?

This is a consequence of my implementation that others probably don't have.  When decoding mt5, I always keep a set of [key,value] tuples until all of the items have been decoded.  Then, if the keys are all strings, I convert the tuples to a JS Object, otherwise I convert them to a Map.  If I've already converted to a Map in mt5 processing, it's too late to (for example) throw an error if there is an unexpected duplicate key.

— 
Joe Hildebrand