guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sxml-match example from manual fails


From: Aidan Gauland
Subject: sxml-match example from manual fails
Date: Sun, 10 Jun 2012 14:19:37 +1200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.4) Gecko/20120510 Icedove/10.0.4

I'm trying to figure out how to use sxml-match, so I tried an example
from the Guile manual:
https://www.gnu.org/software/guile/manual/html_node/sxml_002dmatch.html

"The example below illustrates the pattern matching of an XML element:

     (sxml-match '(e (@ (i 1)) 3 4 5)
       [(e (@ (i ,d)) ,a ,b ,c) (list d a b c)]
       [,otherwise #f])

Each clause in sxml-match contains two parts: a pattern and one or more
expressions which are evaluated if the pattern is successfully match.
The example above matches an element e with an attribute i and three
children."

But guile doesn't seem to like it:
$ guile
GNU Guile 2.0.5-deb+1-3
[...]
scheme@(guile-user)> (sxml-match '(e (@ (i 1)) 3 4 5) [(e (@ (i ,d)) ,a
,b ,c) (list d a b c)] [,otherwise #f])
While compiling expression:
ERROR: Syntax error:
unknown file:1:0: source expression failed to match any pattern in form
(@ (i (unquote d)))

So, can someone tell me whether there's an error in the manual?

Regards,
Aidan Gauland




reply via email to

[Prev in Thread] Current Thread [Next in Thread]