From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: nalaginrut Newsgroups: gmane.lisp.guile.devel Subject: Re: can't use variable in sxml-match? Date: Fri, 20 May 2011 10:26:48 +0800 Organization: HFG Message-ID: <1305858408.1981.26.camel@Renee-desktop> References: <1305853596.1981.13.camel@Renee-desktop> Reply-To: NalaGinrut@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1305858429 2878 80.91.229.12 (20 May 2011 02:27:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 20 May 2011 02:27:09 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri May 20 04:27:04 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QNFQd-00061u-LW for guile-devel@m.gmane.org; Fri, 20 May 2011 04:27:03 +0200 Original-Received: from localhost ([::1]:59891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNFQc-0002Og-Tg for guile-devel@m.gmane.org; Thu, 19 May 2011 22:27:02 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:33771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNFQa-0002OQ-3k for guile-devel@gnu.org; Thu, 19 May 2011 22:27:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNFQY-0000Wu-Bc for guile-devel@gnu.org; Thu, 19 May 2011 22:26:59 -0400 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:42826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNFQY-0000Wp-2F for guile-devel@gnu.org; Thu, 19 May 2011 22:26:58 -0400 Original-Received: by iyh42 with SMTP id 42so3456176iyh.0 for ; Thu, 19 May 2011 19:26:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:reply-to:to:in-reply-to:references :content-type:organization:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=+aMpp/BqL6AO+D/MSZFld4q3IrPWkdYiKBRMwbHi58o=; b=TQUcPN1L0y4EzT4YqeNzOEKR2CUmpxrQsJdvD45ChCTEHSNrsqDv7VJAy1I/O8FsNP iqJj2uvUnnVJmOubH+M8pMTdX9M1oQ4XA1yck81tD5L6p5l07jzycU1Y/OM2559xzx2k axe7uBvipMPRndJlpZ50bWM8pG4K2dw0kddX4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:reply-to:to:in-reply-to:references:content-type :organization:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=ozUFSal28WlO1icP1BUKwoxDx3my09HfWPh1qKpmvS1cvSWVgenZ8OkINvwifRfrHy f/36D3h9inNkNFjAa6j0a+pPY9AKufqrIdgVJbaleFvSB7OjQJRluSoE4Qo/uNn3Pjio TZ2umT3NjBTy7J52esmlzFgFH8OzaDmwJPW5s= Original-Received: by 10.42.153.5 with SMTP id k5mr4808508icw.84.1305858417336; Thu, 19 May 2011 19:26:57 -0700 (PDT) Original-Received: from [192.168.100.100] ([183.15.158.157]) by mx.google.com with ESMTPS id k19sm875119icj.17.2011.05.19.19.26.53 (version=SSLv3 cipher=OTHER); Thu, 19 May 2011 19:26:56 -0700 (PDT) In-Reply-To: <1305853596.1981.13.camel@Renee-desktop> X-Mailer: Evolution 2.28.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12506 Archived-At: 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---