unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Matt Wette <matt.wette@gmail.com>
To: guile-devel@gnu.org
Subject: generating SXML trees in guile
Date: Sat, 9 Jan 2021 15:50:56 -0800	[thread overview]
Message-ID: <60bd162e-c64e-2a4a-4691-49dedd953e22@gmail.com> (raw)

This is a FYI, not saying this is a bug.

I'm digging into the sxml xpath procedures and came across a potential
issue with using sxml in Guile.

I believe I remember that Oleg's SXML code relies on the fact that no
nodes a sxml tree are eq?.   For example, in the SXML tree

     (define sx1  '(*TOP* (a "1") (a "1)))

node-parent in (sxml xpath) depends on the fact that

     (eq? (list-ref sx1 1) (list-ref sx1 2)
=>
     #f

But the result, in Guile 3.0.4, is
     #t

I'm guessing this is cse optimization at work.  I tried this also:

(let* ((sx2 '())
        (sx2 (cons '(a "1") sx2))
        (sx2 (cons '(a "1") sx2))
        (sx2 (cons '*TOP* sx2)))
   (eq? (list-ref sx2 1) (list-ref sx2 2)))
=>
#t

In my sandbox, I'm using copy-tree which seems to be changing
the #t to #f, so at least that works.

Matt




                 reply	other threads:[~2021-01-09 23:50 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=60bd162e-c64e-2a4a-4691-49dedd953e22@gmail.com \
    --to=matt.wette@gmail.com \
    --cc=guile-devel@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).