chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] -no-parentheses-synonyms broken?


From: Peter Bex
Subject: Re: [Chicken-users] -no-parentheses-synonyms broken?
Date: Fri, 30 Aug 2013 10:23:03 +0200
User-agent: Mutt/1.4.2.3i

On Fri, Aug 30, 2013 at 02:08:43AM -0600, Matt Gushee wrote:
> On Fri, Aug 30, 2013 at 1:39 AM, Peter Bex <address@hidden> wrote:
> > On Fri, Aug 30, 2013 at 01:17:40AM -0600, Matt Gushee wrote:
> 
> >> I hypothesize that filter expressions in the native sxpath syntax
> >> don't work because they are delimited with []
> >
> > That makes absolutely no sense; the "native" sxpath surface syntax is
> > unrelated to the textual path syntax; they're plain s-expressions, in
> > which [] is disallowed in regular R5RS syntax.
> 
> I suppose you must be right. I was going by Example 18 at
> http://modis.ispras.ru/Lizorkin/sxml-tutorial.html#hevea:sxpathlib ,
> which is the only example I've found of a filter expression in the
> native syntax (and I know there was a definite reason I didn't want to
> use txpath -- I think it was because it doesn't handle namespace
> prefixes). I was guessing that sxpath must introduce a syntax
> modification so that [] would be specially processed. I don't know
> enough about the nuts and bolts of Scheme to know if that is a
> reasonable guess, but from what you say, maybe not. So perhaps the
> example is wrong?

I don't know, [] has no special function or is invalid in standard Scheme
depending on the revision of the standard you read.  You'd have to ask
Dmitry Lizorkin (the author of that tutorial) how he intended this
particular example.

The [] in textual XPath is a predicate for the selected set; in sxpath
AFAIK that's done by appending a predicate option within an extra set
of parens.  I'm unsure (sxpath syntax confuses me no end), but I think
the example ought to be something like:
(sxpath '(bib (book (publisher ((equal? "Addison-Wesley")))) title))

Hope this helps!

Cheers,
Peter
-- 
http://www.more-magic.net



reply via email to

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