bug#79680: immutable lists
Kyuvi via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" <[email protected]> Wed, 22 Oct 2025 15:24:42 +0200
| Newsgroups | gmane.lisp.guile.bugs |
|---|---|
| Message-ID | <trinity-47dbad9f-f477-4fbe-88c8-433c1919d76e-1761139482925@3c-app-mailcom-bs10> |
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hi</div> <div> </div> <div>I am using guile 3.0.5-4, on debian running on an intel amd64 machine</div> <div> </div> <div>There is an inconsestency between "alist-set!" and "set-cdr!" </div> <div> </div> <div>When an alist is defineed with quote e.g (define al '((#:a . 2)), using alist-set! returns an error "expecting mutable pair", but (set-cdr! (assoc #:a al) 4) mutates the value.</div> <div> </div> <div>I have documented the issues in this paste bin - https://pastebin.com/hYjdLpMY</div> <div> </div> <div>On a related note, there is nothing in the guile documentation about quote creating immutable lists and the only mention of the mutability/immutabiltity of lists is here </div> <div> </div> <div>https://www.gnu.org/software/guile/manual/html_node/rnrs-mutable_002dpairs.html </div> <div> </div> <div>which states "All pairs in Guile are mutable" which I am not sure is right. </div> <div> </div> <div> <div>https://www.gnu.org/software/guile/manual/html_node/rnrs-mutable_002dstrings.html also states that "All strings in Guile are</div> <div>mutable" but </div> <div> </div> <div>(let ((s "abc"))</div> <div> (string-set! s 2 #\d)) </div> <div> </div> <div>raises an exception.</div> <div> </div> <div>I hope this is clear enough, this is the first time I am reporting a bug about guile. Feel free to contact me if you need more information,</div> <div> </div> <div>Thanks for all the work you put into guile</div> <div> </div> <div>Kyuvi</div> <div> </div> </div></div></body></html>