GNU bug report logs - #58068
pretty-print corrupts data modified by set-cdr!

Previous Next

Package: guile;

Reported by: slbtty <shenlebantongying <at> gmail.com>

Date: Sun, 25 Sep 2022 07:44:03 UTC

Severity: normal

To reply to this bug, email your comments to 58068 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#58068; Package guile. (Sun, 25 Sep 2022 07:44:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to slbtty <shenlebantongying <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Sun, 25 Sep 2022 07:44:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: slbtty <shenlebantongying <at> gmail.com>
To: bug-guile <at> gnu.org
Subject: pretty-print corrupts data modified by set-cdr!
Date: Sat, 24 Sep 2022 18:09:45 -0400
GNU Guile 3.0.8

Using `guile3 < file.scm` to run the code below will makes the result
of tp unpredictable (pointing to very random things)

I am not sure about the set-cdr! and quote usage. However, i runned
the same code in other schemes, mit, chicken, racket/r6rs, gambit, and
they all yield tl as (1 2 3).

(use-modules (ice-9 pretty-print))
(define tl '(1 2))
(define tp (cdr tl))
(set-cdr! tp (cons 3 '()))
  (pretty-print tl)
  (pretty-print tp)
---

However, if i use plain old (display tp), the code will out put
expected valve (1 2 3) (3)
(define tl '(1 2))
(define tp (cdr tl))
(set-cdr! tp (cons 3 '()))
  (display tl) (newline)
  (display tp) (newline)

---

Context:

I am using guile3's repl and whenever i access a variable's by typing
its name after (set-cdr!), the result will goes wild.




This bug report was last modified 1 year and 214 days ago.

Previous Next


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