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

Joe Hildebrand <> Fri, 19 February 2021 00:06 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id ABCFE3A1A7D for <>; Thu, 18 Feb 2021 16:06:49 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.697
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: (amavisd-new); dkim=neutral reason="invalid (public key: not available)"
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id PcOsq0oxDLjr for <>; Thu, 18 Feb 2021 16:06:48 -0800 (PST)
Received: from ( [IPv6:2607:f8b0:4864:20::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 8A3C83A1A78 for <>; Thu, 18 Feb 2021 16:06:48 -0800 (PST)
Received: by with SMTP id d20so4037097oiw.10 for <>; Thu, 18 Feb 2021 16:06:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; 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;; 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 with ESMTPSA id d23sm1540002oic.4.2021. (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.\))
From: Joe Hildebrand <>
In-Reply-To: <>
Date: Thu, 18 Feb 2021 17:06:44 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <> <> <> <> <> <> <> <> <> <> <> <>
To: Carsten Bormann <>
X-Mailer: Apple Mail (2.3654.
Archived-At: <>
Subject: Re: [Cbor] Mutable/Immutable (Re: hildjj/cbor-map-entries: Explicit Map datatype for CBOR, in array format)
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 19 Feb 2021 00:06:50 -0000

On Feb 18, 2021, at 3:44 PM, Carsten Bormann <> 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