unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: slbtty <shenlebantongying@gmail.com>
To: 58068@debbugs.gnu.org
Subject: bug#58068: pretty-print corrupts data modified by set-cdr!
Date: Sat, 24 Sep 2022 18:09:45 -0400	[thread overview]
Message-ID: <CAFu5e0KXvXHOe5=55Tyu7drBUNo2h9MN9ymLf1p6vMkApmVR4w@mail.gmail.com> (raw)

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.





                 reply	other threads:[~2022-09-24 22:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFu5e0KXvXHOe5=55Tyu7drBUNo2h9MN9ymLf1p6vMkApmVR4w@mail.gmail.com' \
    --to=shenlebantongying@gmail.com \
    --cc=58068@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).