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>&nbsp;</div>

<div>I am using guile 3.0.5-4, on debian running on an intel amd64 machine</div>

<div>&nbsp;</div>

<div>There is an inconsestency between &quot;alist-set!&quot; and &quot;set-cdr!&quot;&nbsp;</div>

<div>&nbsp;</div>

<div>When an alist is defineed with quote e.g (define al &#39;((#:a . 2)), using alist-set! returns an error &quot;expecting mutable pair&quot;, but (set-cdr! (assoc #:a al) 4) mutates&nbsp; the value.</div>

<div>&nbsp;</div>

<div>I have documented the issues in this paste bin - https://pastebin.com/hYjdLpMY</div>

<div>&nbsp;</div>

<div>On a related note, there is nothing in the guile documentation about quote creating&nbsp; immutable lists and the only mention of the mutability/immutabiltity of lists is here&nbsp;</div>

<div>&nbsp;</div>

<div>https://www.gnu.org/software/guile/manual/html_node/rnrs-mutable_002dpairs.html&nbsp;</div>

<div>&nbsp;</div>

<div>which states &quot;All pairs in Guile are mutable&quot; which I am not sure is right.&nbsp;</div>

<div>&nbsp;</div>

<div>
<div>https://www.gnu.org/software/guile/manual/html_node/rnrs-mutable_002dstrings.html also states that &quot;All strings in Guile are</div>

<div>mutable&quot; but&nbsp;</div>

<div>&nbsp;</div>

<div>(let ((s &quot;abc&quot;))</div>

<div>&nbsp; &nbsp; &nbsp; (string-set! s 2 #&#92;d))&nbsp;</div>

<div>&nbsp;</div>

<div>raises an exception.</div>

<div>&nbsp;</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>&nbsp;</div>

<div>Thanks for all the work you put into guile</div>

<div>&nbsp;</div>

<div>Kyuvi</div>

<div>&nbsp;</div>
</div></div></body></html>