Re: [Cbor] Mutable/Immutable (Re: hildjj/cbor-map-entries: Explicit Map datatype for CBOR, in array format)

Joe Hildebrand <hildjj@cursive.net> Fri, 19 February 2021 00:06 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 ABCFE3A1A7D for <cbor@ietfa.amsl.com>; Thu, 18 Feb 2021 16:06:49 -0800 (PST)
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 PcOsq0oxDLjr for <cbor@ietfa.amsl.com>; Thu, 18 Feb 2021 16:06:48 -0800 (PST)
Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) (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 8A3C83A1A78 for <cbor@ietf.org>; Thu, 18 Feb 2021 16:06:48 -0800 (PST)
Received: by mail-oi1-x22d.google.com with SMTP id d20so4037097oiw.10 for <cbor@ietf.org>; Thu, 18 Feb 2021 16:06:48 -0800 (PST)
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=Vu67UTBes/oADSQaP09UULEbxtEjKDrHsVMMWWyYM1Y=; b=GMGoffH8Aqe3Xrxn2zPoBZFIOPMqi0/cDFjIAkAROHHP1we3rs2GmeB4Wj3qIT5bcd 8mYdgLzMqidglj7ri4DN7ZLGYhzVYK1PiNBfKFCzO4gUnceIrS2zXJsH7NfIsOR8JVdQ ZOM5YvL+yxCCp9BwsXAofnpgpnrS0lnbW6agI=
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=Vu67UTBes/oADSQaP09UULEbxtEjKDrHsVMMWWyYM1Y=; b=bdoXQ277RukV/uA3l50PosKZrXL7eQcH4my/2rbKaZKLWFGDCNmJvWXJaWsT2TLraB 5XI1uXYMYsYN9zoAMRYJUTuZ/BGCD/ckUXPWDSYKceHIOo7HN6xBpRGkherSD3o5l5m8 pgVgREq30xr1ofsR76i2kV979Ti41ZgfSPMxe2gHngfQT+iL5CQv/J9G3r11VDTy0tIB iXbQ62VnijAMTuWLhpXRRInp4tQl6xLuVkdOQm1TG0Tt7+Bd0KW0Ct5IEXDSH5nj9f5k lQeSYRJZOFtcckUu63eEUYzatjUsJvPgN3txMaedoxOHOr8OVcXxems+Z+Q6aDVlTFOS EQ1A==
X-Gm-Message-State: AOAM530yvuA2H09v0U09phDYz3FxKGrc8bTR2D+flPPnGAveCKT1g/Ri 5hicHx51SWn4UBYuEzPqyQF5rw==
X-Google-Smtp-Source: ABdhPJyNERH//by59VJrHPSnQAfe0JyP3PdOwoq73eSHJ1vEY/W/U86wPq1RCqY+UYVGw0NmR78UTw==
X-Received: by 2002:a05:6808:bc6:: with SMTP id o6mr2932983oik.76.1613693207649; Thu, 18 Feb 2021 16:06:47 -0800 (PST)
Received: from ?IPv6:2601:282:200:3758:7479:b77e:8b77:b5d5? ([2601:282:200:3758:7479:b77e:8b77:b5d5]) by smtp.gmail.com with ESMTPSA id d23sm1540002oic.4.2021.02.18.16.06.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Feb 2021 16:06:47 -0800 (PST)
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: <1A224687-3725-41FE-A23A-5A730F88BFDE@tzi.org>
Date: Thu, 18 Feb 2021 17:06:44 -0700
Cc: cbor@ietf.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <3AA8149B-5FED-4841-BE08-B7E92CDAE47C@cursive.net>
References: <87zh02kpf5.fsf@hobgoblin.ariadne.com> <0faeb37c36d5b1f40c37f82e62be1be9@mothers-arms.co.uk> <ED6F6174-2643-4B7F-8ED7-414DD5FD9C39@tzi.org> <F6BDBA57-34F4-46FE-9806-6A227AC214EA@mothers-arms.co.uk> <DC0D444C-3231-4029-B0BB-5EC02863B72A@cursive.net> <999B078D-C4B2-4B04-8487-7ECEFEB953DF@cursive.net> <94bbc990fcf388ae5fd01c06274ed58a@mothers-arms.co.uk> <72053102-1BA1-4281-9F17-CF7A65EEA907@island-resort.com> <05798259-49C4-4442-84A3-9FD13D0BDB5B@tzi.org> <cbc320f27386e06a674a02c0f2f1b6e6@mothers-arms.co.uk> <2631BC6B-F0D2-4756-B129-1B52F18EB6B1@cursive.net> <1A224687-3725-41FE-A23A-5A730F88BFDE@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/2jilzCN_7kdcN1k81ThLmAri7hM>
Subject: Re: [Cbor] Mutable/Immutable (Re: hildjj/cbor-map-entries: Explicit Map datatype for CBOR, in array format)
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: Fri, 19 Feb 2021 00:06:50 -0000

On Feb 18, 2021, at 3:44 PM, Carsten Bormann <cabo@tzi.org> wrote:
> 
> The structures created by record-tuple are deeply immutable, so the below may not be relevant for your use case.
> 
> How would mutable and immutable interact?

Pick one for any given item; if you use both, it might be well-formed but it's not valid.  The tag applies to everything nested inside.

> I assume an immutable tag make its whole content immutable.

Yes, I expect.   Both tags also probably only applies to Maps and Arrays.

> Can you get back using a nested mutable?

Immutable can be nested inside mutable, but not the other way around, I think.  I think I'd just ignore it rather than having it be an error, but I would be easy to talk out of that approach.

> What is the default state at the top?

Implementation-defined?  I might make it an option once I have access to immutable types.

— 
Joe Hildebrand