unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#32841: assoc-set fails with dot notation association list
@ 2018-09-25 20:33 Hood, Christopher L.
  2018-09-25 22:04 ` John Cowan
  2018-09-27  3:02 ` Mark H Weaver
  0 siblings, 2 replies; 4+ messages in thread
From: Hood, Christopher L. @ 2018-09-25 20:33 UTC (permalink / raw)
  To: 32841

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-27 12:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).