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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: lloda <lloda <at> sarc.name>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#32841: closed (assoc-set fails with dot notation association
 list)
Date: Tue, 22 Oct 2024 17:52:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 22 Oct 2024 19:51:00 +0200
with message-id <786E6D89-2F2F-4EBF-BA31-7F1E08AF0F33 <at> sarc.name>
and subject line Re: bug#32841: assoc-set fails with dot notation association list
has caused the debbugs.gnu.org bug report #32841,
regarding assoc-set fails with dot notation association list
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
32841: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32841
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: "Hood, Christopher L." <Christopher.Hood <at> gtri.gatech.edu>
To: "bug-guile <at> gnu.org" <bug-guile <at> gnu.org>
Subject: assoc-set fails with dot notation association list
Date: Tue, 25 Sep 2018 20:33:41 +0000
[Message part 3 (text/plain, inline)]
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
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: lloda <lloda <at> sarc.name>
To: 陈有骏 <2024110144 <at> mails.szu.edu.cn>,
 "bug-guile <at> gnu.org" <bug-guile <at> gnu.org>
Cc: 32841-done <at> debbugs.gnu.org
Subject: Re: bug#32841: assoc-set fails with dot notation association list
Date: Tue, 22 Oct 2024 19:51:00 +0200
Fixed in 818b879b2e481943340e86dbb5b93f12021206c5.

Thanks

  lloda



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.