[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: can't use variable in sxml-match?
From: |
Ian Price |
Subject: |
Re: can't use variable in sxml-match? |
Date: |
Fri, 20 May 2011 04:55:20 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Hi guilers,
Just a note to say that we found a solution to nalaginrut's problem on IRC.
(lambda (mypattern)
;; Instead of testing the head of the pattern in the sxml-match, I
;; have moved it out to here.
(let* ((new-tag (if (equal? mypattern (car cl))
'success
'fail))
;; replace the head with 'success or 'fail depending on a match
(new-expr (cons new-tag (cdr cl))))
(sxml-match new-expr
;; here we test against the new head
[(success (@ (type ,tv)) ,cv) ...]
[,otherwise #f])))
Another suggestion was to use syntax-rules to create the match pattern
at expand time. If anyone else has a better solution, feel free to pipe
up. :)
Ian