unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* generating SXML trees in guile
@ 2021-01-09 23:50 Matt Wette
  0 siblings, 0 replies; only message in thread
From: Matt Wette @ 2021-01-09 23:50 UTC (permalink / raw)
  To: guile-devel

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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-09 23:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-09 23:50 generating SXML trees in guile Matt Wette

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