Subject: bug#32841: closed (Re: bug#32841: assoc-set fails with dot notation association list)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 22 Oct 2024 17:52:02 +0000

Your bug report

#32841: assoc-set fails with dot notation association list

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
32841: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32841
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#32841: assoc-set fails with dot notation association list
From: lloda <[email-masked]>
To: 陈有骏 <[email-masked]>, "[email-masked]" <[email-masked]>
Cc: [email-masked]
Date: Tue, 22 Oct 2024 19:51:00 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Fixed in 818b879b2e481943340e86dbb5b93f12021206c5.

Thanks

  lloda

Subject: assoc-set fails with dot notation association list
From: "Hood, Christopher L." <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Tue, 25 Sep 2018 20:33:41 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

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