Subject: bug#75364: closed (Re: bug#75364: Manual: Alist example does not work)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 04 Jan 2025 23:35:02 +0000

Your bug report

#75364: Manual: Alist example does not work

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

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

Subject: Re: bug#75364: Manual: Alist example does not work
From: lloda <[email-masked]>
To: Jens Egon Nyborg <[email-masked]>
Cc: [email-masked]
Date: Sun, 5 Jan 2025 00:34:32 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

This is a duplicate of  https://bugs.gnu.org/32841 <https://bugs.gnu.org/32841> which was fixed in 818b879b2e481943340e86dbb5b93f12021206c5.

The online manual should update when 3.0.11 is released. 

Regards

Subject: Manual: Alist example does not work
From: Jens Egon Nyborg <[email-masked]>
To: [email-masked]
Date: Sat, 4 Jan 2025 16:59:15 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

I run

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

followed by

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

and get

"ice-9/boot-9.scm:1676:22: In procedure raise-exception:
In procedure set-cdr!: Wrong type argument in position 1 (expecting 
mutable pair): ("Florida" . "Miami")

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue."

(In geiser in emacs on Arch)

Warning: In my own code it actually worked on and off.

Work-around: Use

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

apparently quoted lists are not mutable!