unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: "Hood, Christopher L." <Christopher.Hood@gtri.gatech.edu>
To: 32841@debbugs.gnu.org
Subject: bug#32841: assoc-set fails with dot notation association list
Date: Tue, 25 Sep 2018 20:33:41 +0000	[thread overview]
Message-ID: <d61a791aaa734245ac705bb5196ff18e@gtri.gatech.edu> (raw)

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

This fails with code pulled straight out of the Guile manual example (section 6.6.20.6).

(define capitals '(("New York" . "Albany")
                   ("Oregon"   . "Salem")
                   ("Florida"  . "Miami")))

Okay, that works define to define alist capitals. Now let's try another part of the example:


(set! capitals

      (assoc-set! capitals "Florida" "Tallahassee"))

This yields the error:

ERROR: In procedure assoc-set!:
In procedure set-cdr!: Wrong type argument in position 1 (expecting mutable pair): ("Florida" . "Miami")

I've experienced this behavior with builds of both Guile 2.2.2 and Guile 2.2.4.

I'll note that if you define the alist so its initial contents are defined using a quasiquote and the cons form instead of dot notation, this error is not reached. I'm not sure if the error is valid or not, but in any case, the code that produces is listed as an valid example in the manual, so that doesn't seem right.

chris

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

             reply	other threads:[~2018-09-25 20:33 UTC|newest]

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

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=d61a791aaa734245ac705bb5196ff18e@gtri.gatech.edu \
    --to=christopher.hood@gtri.gatech.edu \
    --cc=32841@debbugs.gnu.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).