From unknown Mon Aug 11 19:02:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#58066: pretty-print will make data modified by set-cdr! to random value Resent-From: slbtty Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 25 Sep 2022 07:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58066 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 58066@debbugs.gnu.org X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16640918378932 (code B ref -1); Sun, 25 Sep 2022 07:44:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Sep 2022 07:43:57 +0000 Received: from localhost ([127.0.0.1]:45782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocMIu-0002Jy-Jl for submit@debbugs.gnu.org; Sun, 25 Sep 2022 03:43:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:53542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc1ys-0004Wv-8J for submit@debbugs.gnu.org; Sat, 24 Sep 2022 06:01:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oc1ys-00039p-1R for bug-guile@gnu.org; Sat, 24 Sep 2022 06:01:54 -0400 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]:34809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oc1yq-0004Wx-AB for bug-guile@gnu.org; Sat, 24 Sep 2022 06:01:53 -0400 Received: by mail-lf1-x12a.google.com with SMTP id j16so3804043lfg.1 for ; Sat, 24 Sep 2022 03:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=6x6pfnpV0SCn5CpsjhuBoMZOeLUCIRjcwqGNbs0ExSs=; b=W+M6gDhlVE9iLF5VaH1P7fU/qi1otNAVxl1lGWmoeQ3Z22GYaOghoOWnHwBJATeX6X 1czizrRZscCAe9quGjqY0dD0fyfScOU9ggiGRU+kwSvnBLZXN/ETp+hZWU3ETrB745cq 8UpnbgG9tefmvpRyuo5nHty14TgSGUHMf7Y6VbP3o2XPjzVP87g5MtHxCsvQ+yYUAxRJ ASSUCwFUCeBux1eVW2vTLcJvJqUj/TPgiati8daVmSPahQfRRvCP/NKCKi2b4CZJmO3s ad5agqWaUOagEYkqgtB9J7Yqx62JdkhTMMT4Kw3Gt2pr0WUyx7XX/Ynw41R5/hU0ORGu R3Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=6x6pfnpV0SCn5CpsjhuBoMZOeLUCIRjcwqGNbs0ExSs=; b=lT7v2wRnrqtoPt3NG7a1IDoQGtqUBmpig5C4RT/hfWu/EwEA+lnuTNThwqNRHuCiX8 A2aIek7/PWMGUa7V6II7Q6NyTFNpCcuC9xs+jEd6c2Op4BqW+Efzcs1paY/ZG1LZY8Py zOOqSD+cplRkEjysBxNRsBbMHzaCfIJYKUYcmFiu4hJlQjY8F6a6vSUJ6refOmsPMTi3 rRypBVxha8GhzKHnDyvtA/GmB4L7O1sytLN1RNKAoLdKcMHCrqFRldys/lzPn30hZNvs J+ncZXXEIAO5HeHFPyYewsV3cmDf+tAuGjmbJ2fGSzHowwp92Lh5+Yy/qjeV7j6yxZqQ NjxQ== X-Gm-Message-State: ACrzQf0gt0OrE8EbIn2X/pt2Le09aME68lD4lIj4nFcSnB0ko+AthxC2 MSY1gSiLgWlzsndZLf2gDqN+JkYG7X4NHNvJKJ4YJzPd3K8= X-Google-Smtp-Source: AMsMyM7hzGuhetwsR/+OVa19nLMwNyuQR+/9hNDCH2jKgV0ArQZpZQtM4olwJ4PYOXu/wYvgr4yGWVNYIEBCTVSMyeU= X-Received: by 2002:a05:6512:3052:b0:49e:fcb2:c1e9 with SMTP id b18-20020a056512305200b0049efcb2c1e9mr4565205lfb.260.1664013709725; Sat, 24 Sep 2022 03:01:49 -0700 (PDT) MIME-Version: 1.0 From: slbtty Date: Sat, 24 Sep 2022 06:01:13 -0400 Message-ID: Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=shenlebantongying@gmail.com; helo=mail-lf1-x12a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Mailman-Approved-At: Sun, 25 Sep 2022 03:43:55 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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. From unknown Mon Aug 11 19:02:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#58066: pretty-print will make data modified by set-cdr! to random value Resent-From: Jean Abou Samra Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 25 Sep 2022 10:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58066 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: slbtty , 58066@debbugs.gnu.org Received: via spool by 58066-submit@debbugs.gnu.org id=B58066.166410100823855 (code B ref 58066); Sun, 25 Sep 2022 10:17:02 +0000 Received: (at 58066) by debbugs.gnu.org; 25 Sep 2022 10:16:48 +0000 Received: from localhost ([127.0.0.1]:45920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocOgp-0006Ch-UJ for submit@debbugs.gnu.org; Sun, 25 Sep 2022 06:16:48 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:38989) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocOgl-0006CP-NO for 58066@debbugs.gnu.org; Sun, 25 Sep 2022 06:16:46 -0400 Received: from [172.20.10.5] ([37.170.74.76]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.184]) with ESMTPSA (Nemesis) id 1MGA0o-1oSTbk1eRQ-00GWg7; Sun, 25 Sep 2022 12:16:36 +0200 Message-ID: Date: Sun, 25 Sep 2022 12:16:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 References: Content-Language: en-US From: Jean Abou Samra In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:x1Zo+CGW8zGNILa0q1MFh+FmKiDCQEQHbRHHi89lsurqvj6ZysF 6/1L5wePz7bVZVRtPF5YCM2agbriG8OsJNfrqLqbGtRHihbvTmkeIwWoTBmHZjAGJaxoNJq lsFyrASztQn6O58UgNJdkJphxuwNkroppGhYJchLaf+RZOb9BWHOn26iHi0yu1Chck/8/QM f2ZcITc9tuZXsgjnY5i6Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:zVWgX60lIfo=:VoD9qhjXKsziFWWQQGURZ+ lat3EqN3C+ibLWgfazh7i56N26RCYc/IVJXn2wh0IuxnUrFE90dbIEW0SVScFr9mRpOHOUP7I KVpouvYNLU8qylftfq+YYyOeqXMQEh3CsIyRt+ZOA8Qhx9ZoaTP5GcexEgPa4ItcrIEYBY4sm Mz7zdKbjAoYH4DNn9Cf0mDL7p7R0ToSA9KnGzdAXC3Ulrld0v748xNdj/lUrrJfnMEJ9q/4BU rlWN9NSIxoYAE2+YD+Kf9tviMHknDhqjdA8W9WlULvdF18TndizoZSwKRm4qaah0TezukHtw9 fd+H4coH2+KDYYGGWVlK/J4/q/Y4cZMjRohw2u0DRmBiD7gqVKb3ziTrXUbSSwCMMCBgQcKl/ XlsdG25Bfp2I+HaNWUy0BO4gd+PsSxABC/zxSZidA7pkzes0Jnp15jiztDLExXq7MpKubpoYB DOq/BwBqNqNAYLCFx/yWB2XQCsg5pUDvN3UhcD4uJ3SuOWXYKcluC3JWFLyWzAkFjrWKVi09w ggyiq6rMEBTgLym9SzNcIHjLLNOxT1IFku3G+Z5w475AKjeBDP9/ftL/JEQ0JGaiNzrt7TnO4 /xZeeE7k5ko6/QeitvCbbYkUTR1X56DLqJ3A7lIN05oayrNiKdlbaXjX1h/8XWzhfNYIfwURG vq+3cnZP52KXXiGbuyaMKZBUJqQJw84WAz23WkEP0PXFeaUGyg3t0URlECO0exYE+iqrFk1Jb uDlF0Gl0x/Nn4tkmcNZkfYIn4KGlXLy5+jDmS7lkr+RGwc2qfnaIhS0870ETRtxjbs8wkO3Ra qZfPd6u X-Spam-Score: -1.8 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) Le 24/09/2022 à 12:01, slbtty a écrit : > 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. Interesting. It looks like scm_is_mutable_pair is broken? It's defined (in pairs.h) as static inline int scm_is_mutable_pair (SCM x) {   /* Guile embeds literal pairs into compiled object files.  It's not      valid Scheme to mutate literal values.  Two practical reasons to      enforce this restriction are to allow literals to share share      structure (pairs) with other literals in the compilation unit, and      to allow literals containing immediates to be allocated in the      read-only, shareable section of the file.  Attempting to mutate a      pair in the read-only section would cause a segmentation fault, so      to avoid that, we really do need to enforce the restriction. */   return scm_is_pair (x) && GC_is_heap_ptr (SCM2PTR (x)); } I don't know why that breaks or how to fix it, though. As you can read from the comment, this code is actually invalid Scheme, since it mutates literal data. However, it is true that Guile should raise an error for this, not segfault (which is what it does for me) or start printing random things. If you define tl as (list 1 2 3) instead of '(1 2 3), everything will be fine. From unknown Mon Aug 11 19:02:37 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: slbtty Subject: bug#58066: closed (Re: bug#58066: pretty-print will make data modified by set-cdr! to random value) Message-ID: References: <609596e5ad9cb6b9726d9fe176d12ac07d0b9f26.camel@abou-samra.fr> X-Gnu-PR-Message: they-closed 58066 X-Gnu-PR-Package: guile Reply-To: 58066@debbugs.gnu.org Date: Wed, 19 Jul 2023 22:18:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1689805082-22308-1" This is a multi-part message in MIME format... ------------=_1689805082-22308-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #58066: pretty-print will make data modified by set-cdr! to random value which was filed against the guile package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 58066@debbugs.gnu.org. --=20 58066: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D58066 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1689805082-22308-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 58066-done) by debbugs.gnu.org; 19 Jul 2023 22:17:20 +0000 Received: from localhost ([127.0.0.1]:57227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMFU0-0005mL-Ch for submit@debbugs.gnu.org; Wed, 19 Jul 2023 18:17:20 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:54981) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMFTy-0005m2-Ld for 58066-done@debbugs.gnu.org; Wed, 19 Jul 2023 18:17:19 -0400 Received: from [172.20.10.5] ([37.169.36.180]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.168]) with ESMTPSA (Nemesis) id 1MtO06-1q4BOg2zWg-00utdw for <58066-done@debbugs.gnu.org>; Thu, 20 Jul 2023 00:17:13 +0200 Message-ID: <609596e5ad9cb6b9726d9fe176d12ac07d0b9f26.camel@abou-samra.fr> Subject: Re: bug#58066: pretty-print will make data modified by set-cdr! to random value From: Jean Abou Samra To: 58066-done@debbugs.gnu.org Date: Thu, 20 Jul 2023 00:17:10 +0200 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-sV0DhovVNXBeRfbrGrP8" User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Provags-ID: V03:K1:770msDTgQTrshpL+Fxody9pLu8UaoZd6hRPRPQX1U3gzn3gl3bg WO8W+2CBMIamG3ZhnL4cz7xhynZQkksGm7zl/L4U2wUoTJkKs45OuHfhxHHYE6BCOIQtR1S Pk16VeU0vmJORSW4vPLGu+HQiH6ZMrqN0xakqhLkTpr118qDj0Rb5IF6PNFGrmhcr/hfHWP zDz9W8rmp0VYhWlo2qtNw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:VKi0ueK+ItE=;3kCCxSXeixpE/GuFykYxUicLcx/ 6x4I3iLdmUYz77Ou8t7hmJqwkHt2wm4Ascii21Tb5j/f2fWb0Qgm/VS2EjMro+/eyrCM4EYOI /knEtFypBctsv1wC+Wj2Co4zF4gc8cOKn/ZkzSRYwMMnfCxGxTNqcyr3RaKCuHr7WHt5GNu1R cHwLTB/uXs5apiltlt9QcYFAuUuyLno8A5WsWvzneJVinzuVwh8eyuQR1CWUrESLkAEhbIsay OofGxYoaZJdKHtUmJo4FEdBOZOjSvrO0jd+kT0YlLjxn3aXerbbrJdKbOBeJ5FO+xOezx36lp XkERSGsxCz6OO2q9+BL31DHv01rmSP7+7n3UMB1tUZAWnSkUfEh2lL6+70ddtvwYRhUEaq3Ik xOlMAOSP6IP7qAZG9QtcoNOvCwAwE51R9rCESZ9xZ/WW3GIS4nZ7rDwSQQs8iZvPfNMqHyLlE Fe7HaavaHRTYFaB6KHgLQkxYfKW4vIfgdCHlsFCjjc6hMwlKxSXEXBxqXJ7BIiAffocCxOBuZ xulpga4/xZoaLyLkrHYcmy4G1WwT5X3jVzSNawulszANpqoAkMe2Bsw6wGJGopTfwBiNu65Bu wqJB4i8QrHxewTtHDIr68JVlKRmUCL4De1uUJALmItr9hhT7Mb4PvQW5jCOEznubta6sQX+tG rdMX/SGXDN+jgIJ3z+Oz5p5mZKqMHg4w/fXutW/y1A== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 58066-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-sV0DhovVNXBeRfbrGrP8 Content-Type: multipart/alternative; boundary="=-dcb3iRFuQpnNlLvb8Xyu" --=-dcb3iRFuQpnNlLvb8Xyu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Closing this as a duplicate of=C2=A0https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D16060 --=-dcb3iRFuQpnNlLvb8Xyu Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
--=-dcb3iRFuQpnNlLvb8Xyu-- --=-sV0DhovVNXBeRfbrGrP8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSZ7TKxnKGyBvBjzBmj8PYLiTOX/gUCZLhg5gAKCRCj8PYLiTOX /t7JAQDzxqvt7vOvs/ErmfBG3WDeNPgDo5z6LxRUHo4jK+5DBgEAmEwwDVG00Yqp p7cCDoIUP2YG/9HWvP0VBmU5n32dhQg= =C5zJ -----END PGP SIGNATURE----- --=-sV0DhovVNXBeRfbrGrP8-- ------------=_1689805082-22308-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 25 Sep 2022 07:43:57 +0000 Received: from localhost ([127.0.0.1]:45782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocMIu-0002Jy-Jl for submit@debbugs.gnu.org; Sun, 25 Sep 2022 03:43:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:53542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc1ys-0004Wv-8J for submit@debbugs.gnu.org; Sat, 24 Sep 2022 06:01:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oc1ys-00039p-1R for bug-guile@gnu.org; Sat, 24 Sep 2022 06:01:54 -0400 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]:34809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oc1yq-0004Wx-AB for bug-guile@gnu.org; Sat, 24 Sep 2022 06:01:53 -0400 Received: by mail-lf1-x12a.google.com with SMTP id j16so3804043lfg.1 for ; Sat, 24 Sep 2022 03:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=6x6pfnpV0SCn5CpsjhuBoMZOeLUCIRjcwqGNbs0ExSs=; b=W+M6gDhlVE9iLF5VaH1P7fU/qi1otNAVxl1lGWmoeQ3Z22GYaOghoOWnHwBJATeX6X 1czizrRZscCAe9quGjqY0dD0fyfScOU9ggiGRU+kwSvnBLZXN/ETp+hZWU3ETrB745cq 8UpnbgG9tefmvpRyuo5nHty14TgSGUHMf7Y6VbP3o2XPjzVP87g5MtHxCsvQ+yYUAxRJ ASSUCwFUCeBux1eVW2vTLcJvJqUj/TPgiati8daVmSPahQfRRvCP/NKCKi2b4CZJmO3s ad5agqWaUOagEYkqgtB9J7Yqx62JdkhTMMT4Kw3Gt2pr0WUyx7XX/Ynw41R5/hU0ORGu R3Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=6x6pfnpV0SCn5CpsjhuBoMZOeLUCIRjcwqGNbs0ExSs=; b=lT7v2wRnrqtoPt3NG7a1IDoQGtqUBmpig5C4RT/hfWu/EwEA+lnuTNThwqNRHuCiX8 A2aIek7/PWMGUa7V6II7Q6NyTFNpCcuC9xs+jEd6c2Op4BqW+Efzcs1paY/ZG1LZY8Py zOOqSD+cplRkEjysBxNRsBbMHzaCfIJYKUYcmFiu4hJlQjY8F6a6vSUJ6refOmsPMTi3 rRypBVxha8GhzKHnDyvtA/GmB4L7O1sytLN1RNKAoLdKcMHCrqFRldys/lzPn30hZNvs J+ncZXXEIAO5HeHFPyYewsV3cmDf+tAuGjmbJ2fGSzHowwp92Lh5+Yy/qjeV7j6yxZqQ NjxQ== X-Gm-Message-State: ACrzQf0gt0OrE8EbIn2X/pt2Le09aME68lD4lIj4nFcSnB0ko+AthxC2 MSY1gSiLgWlzsndZLf2gDqN+JkYG7X4NHNvJKJ4YJzPd3K8= X-Google-Smtp-Source: AMsMyM7hzGuhetwsR/+OVa19nLMwNyuQR+/9hNDCH2jKgV0ArQZpZQtM4olwJ4PYOXu/wYvgr4yGWVNYIEBCTVSMyeU= X-Received: by 2002:a05:6512:3052:b0:49e:fcb2:c1e9 with SMTP id b18-20020a056512305200b0049efcb2c1e9mr4565205lfb.260.1664013709725; Sat, 24 Sep 2022 03:01:49 -0700 (PDT) MIME-Version: 1.0 From: slbtty Date: Sat, 24 Sep 2022 06:01:13 -0400 Message-ID: Subject: pretty-print will make data modified by set-cdr! to random value To: bug-guile@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=shenlebantongying@gmail.com; helo=mail-lf1-x12a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 25 Sep 2022 03:43:55 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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. ------------=_1689805082-22308-1--