unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: John Cowan <cowan@ccil.org>
To: Mark H Weaver <mhw@netris.org>
Cc: 32841@debbugs.gnu.org, Christopher.Hood@gtri.gatech.edu
Subject: bug#32841: assoc-set fails with dot notation association list
Date: Thu, 27 Sep 2018 08:09:46 -0400	[thread overview]
Message-ID: <CAD2gp_RxPVhDxLt_Np_XMP=r2QxY5zVbW-+W65znqqA1f-+Y8A@mail.gmail.com> (raw)
In-Reply-To: <87zhw3d4na.fsf@netris.org>

[-- Attachment #1: Type: text/plain, Size: 627 bytes --]

On Wed, Sep 26, 2018 at 11:03 PM Mark H Weaver <mhw@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@ccil.org
Here lies the Christian, judge, and poet Peter,
Who broke the laws of God and man and metre.

[-- Attachment #2: Type: text/html, Size: 1234 bytes --]

      reply	other threads:[~2018-09-27 12:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25 20:33 bug#32841: assoc-set fails with dot notation association list Hood, Christopher L.
2018-09-25 22:04 ` John Cowan
2018-09-27  3:02 ` Mark H Weaver
2018-09-27 12:09   ` John Cowan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAD2gp_RxPVhDxLt_Np_XMP=r2QxY5zVbW-+W65znqqA1f-+Y8A@mail.gmail.com' \
    --to=cowan@ccil.org \
    --cc=32841@debbugs.gnu.org \
    --cc=Christopher.Hood@gtri.gatech.edu \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).