unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#58066: pretty-print will make data modified by set-cdr! to random value
@ 2022-09-24 10:01 slbtty
  2022-09-25 10:16 ` Jean Abou Samra
  2023-07-19 22:17 ` Jean Abou Samra
  0 siblings, 2 replies; 3+ messages in thread
From: slbtty @ 2022-09-24 10:01 UTC (permalink / raw)
  To: 58066

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)

(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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-19 22:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-24 10:01 bug#58066: pretty-print will make data modified by set-cdr! to random value slbtty
2022-09-25 10:16 ` Jean Abou Samra
2023-07-19 22:17 ` Jean Abou Samra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).