Hi
 
I am using guile 3.0.5-4, on debian running on an intel amd64 machine
 
There is an inconsestency between "alist-set!" and "set-cdr!" 
 
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.
 
I have documented the issues in this paste bin - https://pastebin.com/hYjdLpMY
 
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 
 
https://www.gnu.org/software/guile/manual/html_node/rnrs-mutable_002dpairs.html 
 
which states "All pairs in Guile are mutable" which I am not sure is right. 
 
https://www.gnu.org/software/guile/manual/html_node/rnrs-mutable_002dstrings.html also states that "All strings in Guile are
mutable" but 
 
(let ((s "abc"))
      (string-set! s 2 #\d)) 
 
raises an exception.
 
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,
 
Thanks for all the work you put into guile
 
Kyuvi
 
  • bug#79680: immu... Bug reports for GUILE, GNU's Ubiquitous Extension Language

Reply via email to