From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: guile-user@gnu.org
Subject: sxml-match bad pattern syntax
Date: Tue, 28 Dec 2021 01:21:31 -0500 [thread overview]
Message-ID: <87h7atdzbo.fsf@gnuvola.org> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 328 bytes --]
In an effort to join the current millennium, i have started to
play w/ Guile 2.x's SXML facilities. Good stuff! I've run into
a problem, however, and hope i can get help resolving it here.
The following small program attempts to use ‘sxml-match’ to
remove an unwanted attribute from a (well-formed) SXML snippet.
[-- Attachment #1.2: UNBOGUS --]
[-- Type: text/plain, Size: 303 bytes --]
#!/usr/bin/guile -s
!#
(use-modules
(sxml match))
(define (unbogus x)
(sxml-match x
((a (@ . ,attrs) ...)
`(a (@ ,@(delete '(shape "rect") attrs)) ...))))
(define bad '(a (@ (shape "rect") (href "foo.html")) "kid"))
(pk bad)
(pk (unbogus bad))
;; expect: (a (@ (href "foo.html")) "kid")
[-- Attachment #1.3: Type: text/plain, Size: 754 bytes --]
When i run it, i see it fail w/ error message:
sxml/sxml-match.ss:342:31: Throw to key `sxml-match-error'
with args `(#f "bad pattern syntax (symbol not allowed
in this context)" [...]
(output folded and truncated). To my untrained eye, the form
looks similar to the examples in Info node ‘(guile) sxml-match’
but evidently i am missing something. What?
--
Thien-Thi Nguyen -----------------------------------------------
(defun responsep (query) ; (2021) Software Libero
(pcase (context query) ; = Dissenso Etico
(`(technical ,ml) (correctp ml))
...)) 748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 219 bytes --]
next reply other threads:[~2021-12-28 6:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-28 6:21 Thien-Thi Nguyen [this message]
2021-12-28 7:19 ` sxml-match bad pattern syntax tomas
2021-12-28 7:58 ` Thien-Thi Nguyen
2021-12-28 8:28 ` tomas
2021-12-28 9:21 ` Thien-Thi Nguyen
2021-12-28 10:06 ` tomas
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=87h7atdzbo.fsf@gnuvola.org \
--to=ttn@gnuvola.org \
--cc=guile-user@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).