GNU bug report logs - #32841
assoc-set fails with dot notation association list

Previous Next

Package: guile;

Reported by: "Hood, Christopher L." <Christopher.Hood <at> gtri.gatech.edu>

Date: Tue, 25 Sep 2018 20:41:02 UTC

Severity: normal

Done: lloda <lloda <at> sarc.name>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 32841 <at> debbugs.gnu.org (full text, mbox):

From: John Cowan <cowan <at> ccil.org>
To: Mark H Weaver <mhw <at> netris.org>
Cc: 32841 <at> debbugs.gnu.org, Christopher.Hood <at> gtri.gatech.edu
Subject: Re: bug#32841: assoc-set fails with dot notation association list
Date: Thu, 27 Sep 2018 08:09:46 -0400
[Message part 1 (text/plain, inline)]
On Wed, Sep 26, 2018 at 11:03 PM Mark H Weaver <mhw <at> netris.org> wrote:


> To initialize an alist that will be mutated, you must instead do
> something like this:
>
>   (define capitals (list (cons "New York" "Albany")
>                          (cons "Oregon"   "Salem")
>                          (cons "Florida"  "Miami")))
>

More simply, you can wrap the literal in a call to copy-tree.  This returns
a deep copy of the literal that is fully mutable.

-- 
John Cowan          http://vrici.lojban.org/~cowan        cowan <at> ccil.org
Here lies the Christian, judge, and poet Peter,
Who broke the laws of God and man and metre.
[Message part 2 (text/html, inline)]

This bug report was last modified 209 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.