guile-devel
[Top][All Lists]
Advanced

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

Re: can't use variable in sxml-match?


From: nalaginrut
Subject: Re: can't use variable in sxml-match?
Date: Fri, 20 May 2011 10:26:48 +0800

Sorry, there's a typo caused huge misunderstand in IRC.
Let me fix my letter:
================Begin=================
    (sxml-match
     cl
     [(http://www.w3.org/2005/Atom:content
       (@ (type ,tv)) ,cv)
        ...do something...
     [,otherwise #f])
===============End==================
As you see, I must write "content" with the namespace for some reason.
But I want a more generic solution ,or I must change source code when
namespace changes. Like:
===============Begin===============
(lambda (mypattern)
(sxml-match
  cl
   [(my-pattern  
      (@ (type ,tv)) ,cv)
     ...............
===============End===============

I can't substitute 'http://www.w3.org/2005/Atom:content by a variable,
say ,mypattern. It spews a lot of error message.

And the error message like these:
====================Begin===============
key sxml-match-error, throw_args (#f "bad pattern syntax (not an element
pattern)" (#(syntax-object sxml-match ((top) #(ribcage () () ())
#(ribcage #(s) #((top)) #("i344")) #(ribcage () () ()) #(ribcage #(msg
exp sub) #((top) (top) (top)) #("i339" "i340" "i341")) #(ribcage
#(sxml-match-syntax-error ellipsis? literal? keyword? extract-cata-fun
add-pat-var add-cata-def process-cata-exp process-cata-defs
cata-defs->pvar-lst process-output-action compile-element-pat
compile-end-element compile-attr-list compile-item-list
compile-dotted-pattern-list compile-item) #((top) (top) (top) (top)
(top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top)
(top)) #("i302" "i303" "i304" "i305" "i306" "i307" "i308" "i309" "i310"
"i311" "i312" "i313" "i314" "i315" "i316" "i317" "i318")) #(ribcage ()
() ()) #(ribcage #(stx) #((top)) #("i301"))) (hygiene sxml match))
#(syntax-object (#(syntax-object compile-clause ((m266 top) #(ribcage ()
() ()) shift #(ribcage #(dummy exp cata-fun clause0 clause) #((m2252
top) (top) (top) (top) (top)) #("i2266" "i2267" "i2268" "i2269"
"i2270")) #(ribcage () () ()) #(ribcage #(x) #((m2252 top)) #("i2254")))
(hygiene sxml match)) #(syntax-object (((unquote-splicing (string-append
ns "content")) (@ (type (unquote tv))) (unquote cv)) (begin (if tv (set!
type tv)) (if cv (set! content cv)))) ((top) #(ribcage () () ())
#(ribcage () () ()) #(ribcage #(exp) #((m261 top)) #("i265")) #(ribcage
#(cfun) #((m261 top)) #("i262")) #(ribcage () () ()) #(ribcage () () ())
#(ribcage () () ()) #(ribcage #(content) #((top)) #("i259")) #(ribcage
() () ()) #(ribcage #(type) #((top)) #("i257")) #(ribcage () () ())
#(ribcage #(title) #((top)) #("i255")) #(ribcage () () ()) #(ribcage
#(author-name) #((top)) #("i253")) #(ribcage () () ()) #(ribcage #(feed)
#((top)) #("i251")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage
#(sxml) #((top)) #("i249"))) (hygiene guile-user)) #(syntax-object exp
((m261 top) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(exp)
#((m261 top)) #("i265")) #(ribcage #(cfun) #((m261 top)) #("i262"))
#(ribcage () () ()) shift #(ribcage #(dummy val clause0 clause) #((m2277
top) (top) (top) (top)) #("i2282" "i2283" "i2284" "i2285")) #(ribcage ()
() ()) #(ribcage #(x) #((m2277 top)) #("i2279"))) (hygiene sxml match))
#(syntax-object cfun ((m261 top) #(ribcage () () ()) #(ribcage () () ())
#(ribcage #(exp) #((m261 top)) #("i265")) #(ribcage #(cfun) #((m261
top)) #("i262")) #(ribcage () () ()) shift #(ribcage #(dummy val clause0
clause) #((m2277 top) (top) (top) (top)) #("i2282" "i2283" "i2284"
"i2285")) #(ribcage () () ()) #(ribcage #(x) #((m2277 top)) #("i2279")))
(hygiene sxml match)) (#(syntax-object lambda ((m266 top) #(ribcage ()
() ()) shift #(ribcage #(dummy exp cata-fun clause0 clause) #((m2252
top) (top) (top) (top) (top)) #("i2266" "i2267" "i2268" "i2269"
"i2270")) #(ribcage () () ()) #(ribcage #(x) #((m2252 top)) #("i2254")))
(hygiene sxml match)) () (#(syntax-object call-with-values ((m266 top)
#(ribcage () () ()) shift #(ribcage #(dummy exp cata-fun clause0 clause)
#((m2252 top) (top) (top) (top) (top)) #("i2266" "i2267" "i2268" "i2269"
"i2270")) #(ribcage () () ()) #(ribcage #(x) #((m2252 top)) #("i2254")))
(hygiene sxml match)) (#(syntax-object lambda ((m266 top) #(ribcage ()
() ()) shift #(ribcage #(dummy exp cata-fun clause0 clause) #((m2252
top) (top) (top) (top) (top)) #("i2266" "i2267" "i2268" "i2269"
"i2270")) #(ribcage () () ()) #(ribcage #(x) #((m2252 top)) #("i2254")))
(hygiene sxml match)) () (#(syntax-object sxml-match1 ((m266 top)
#(ribcage () () ()) shift #(ribcage #(dummy exp cata-fun clause0 clause)
#((m2252 top) (top) (top) (top) (top)) #("i2266" "i2267" "i2268" "i2269"
"i2270")) #(ribcage () () ()) #(ribcage #(x) #((m2252 top)) #("i2254")))
(hygiene sxml match)) #(syntax-object exp ((m261 top) #(ribcage () ()
()) #(ribcage () () ()) #(ribcage #(exp) #((m261 top)) #("i265"))
#(ribcage #(cfun) #((m261 top)) #("i262")) #(ribcage () () ()) shift
#(ribcage #(dummy val clause0 clause) #((m2277 top) (top) (top) (top))
#("i2282" "i2283" "i2284" "i2285")) #(ribcage () () ()) #(ribcage #(x)
#((m2277 top)) #("i2279"))) (hygiene sxml match)) #(syntax-object cfun
((m261 top) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(exp)
#((m261 top)) #("i265")) #(ribcage #(cfun) #((m261 top)) #("i262"))
#(ribcage () () ()) shift #(ribcage #(dummy val clause0 clause) #((m2277
top) (top) (top) (top)) #("i2282" "i2283" "i2284" "i2285")) #(ribcage ()
() ()) #(ribcage #(x) #((m2277 top)) #("i2279"))) (hygiene sxml match))
#(syntax-object ((unquote otherwise) #f) ((top) #(ribcage () () ())
#(ribcage () () ()) #(ribcage #(exp) #((m261 top)) #("i265")) #(ribcage
#(cfun) #((m261 top)) #("i262")) #(ribcage () () ()) #(ribcage () () ())
#(ribcage () () ()) #(ribcage #(content) #((top)) #("i259")) #(ribcage
() () ()) #(ribcage #(type) #((top)) #("i257")) #(ribcage () () ())
#(ribcage #(title) #((top)) #("i255")) #(ribcage () () ()) #(ribcage
#(author-name) #((top)) #("i253")) #(ribcage () () ()) #(ribcage #(feed)
#((top)) #("i251")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage
#(sxml) #((top)) #("i249"))) (hygiene guile-user)))) #(syntax-object
escape ((m266 top) #(ribcage () () ()) shift #(ribcage #(dummy exp
cata-fun clause0 clause) #((m2252 top) (top) (top) (top) (top))
#("i2266" "i2267" "i2268" "i2269" "i2270")) #(ribcage () () ())
#(ribcage #(x) #((m2252 top)) #("i2254"))) (hygiene sxml match)))))
((#f) shift #(ribcage () () ()) #(ribcage #(escape) #((m266 top))
#("i270")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage () () ()))
(hygiene guile-user))) (#(syntax-object (unquote-splicing (string-append
ns "content")) ((#f top) shift #(ribcage () () ()) #(ribcage #(escape)
#((m266 top)) #("i270")) #(ribcage () () ()) #(ribcage () () ())
#(ribcage () () ()) #(ribcage () () ()) #(ribcage () () ()) #(ribcage
#(exp) #((m261 top)) #("i265")) #(ribcage #(cfun) #((m261 top))
#("i262")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage () () ())
#(ribcage #(content) #((top)) #("i259")) #(ribcage () () ()) #(ribcage
#(type) #((top)) #("i257")) #(ribcage () () ()) #(ribcage #(title)
#((top)) #("i255")) #(ribcage () () ()) #(ribcage #(author-name)
#((top)) #("i253")) #(ribcage () () ()) #(ribcage #(feed) #((top))
#("i251")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(sxml)
#((top)) #("i249"))) (hygiene guile-user)) #(syntax-object (@ (type
(unquote tv))) ((#f top) shift #(ribcage () () ()) #(ribcage #(escape)
#((m266 top)) #("i270")) #(ribcage () () ()) #(ribcage () () ())
#(ribcage () () ()) #(ribcage () () ()) #(ribcage () () ()) #(ribcage
#(exp) #((m261 top)) #("i265")) #(ribcage #(cfun) #((m261 top))
#("i262")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage () () ())
#(ribcage #(content) #((top)) #("i259")) #(ribcage () () ()) #(ribcage
#(type) #((top)) #("i257")) #(ribcage () () ()) #(ribcage #(title)
#((top)) #("i255")) #(ribcage () () ()) #(ribcage #(author-name)
#((top)) #("i253")) #(ribcage () () ()) #(ribcage #(feed) #((top))
#("i251")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(sxml)
#((top)) #("i249"))) (hygiene guile-user)) #(syntax-object (unquote cv)
((#f top) shift #(ribcage () () ()) #(ribcage #(escape) #((m266 top))
#("i270")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage () () ())
#(ribcage () () ()) #(ribcage () () ()) #(ribcage #(exp) #((m261 top))
#("i265")) #(ribcage #(cfun) #((m261 top)) #("i262")) #(ribcage () ()
()) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(content)
#((top)) #("i259")) #(ribcage () () ()) #(ribcage #(type) #((top))
#("i257")) #(ribcage () () ()) #(ribcage #(title) #((top)) #("i255"))
#(ribcage () () ()) #(ribcage #(author-name) #((top)) #("i253"))
#(ribcage () () ()) #(ribcage #(feed) #((top)) #("i251")) #(ribcage ()
() ()) #(ribcage () () ()) #(ribcage #(sxml) #((top)) #("i249")))
(hygiene guile-user))))
====================End===================


-- 
GNU Powered it
GPL Protected it
GOD Blessed it

HFG - NalaGinrut

--hacker key--
v4sw7CUSMhw6ln6pr8OSFck4ma9u8MLSOFw3WDXGm7g/l8Li6e7t4TNGSb8AGORTDLMen6g6RASZOGCHPa28s1MIr4p-x
 hackerkey.com
---end key---




reply via email to

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