GNU bug report logs - #75364
Manual: Alist example does not work

Previous Next

Package: guile;

Reported by: Jens Egon Nyborg <jens <at> puggaard-nyborg.dk>

Date: Sat, 4 Jan 2025 17:47:05 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: Jens Egon Nyborg <jens <at> puggaard-nyborg.dk>
To: 75364 <at> debbugs.gnu.org
Subject: bug#75364: Manual: Alist example does not work
Date: Sat, 4 Jan 2025 16:59:15 +0100
[Message part 1 (text/plain, inline)]
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!
[Message part 2 (text/html, inline)]

This bug report was last modified 216 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.