bug#75364: Manual: Alist example does not work

2025-01-04 Thread lloda

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

The online manual should update when 3.0.11 is released. 

Regards

bug#75364: Manual: Alist example does not work

2025-01-04 Thread dsmich
From: "Jens Egon Nyborg" 

> apparently quoted lists are not mutable!

True

-Dale



bug#75364: Manual: Alist example does not work

2025-01-04 Thread Jens Egon Nyborg

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!