Re: [Webit-discuss] Re: sxml-match patterns

Jim Bender <jim-WkOkIs/[email protected]> Wed, 25 May 2005 23:15:56 -0500
Newsgroups gmane.lisp.scheme.ssax-sxml
Message-ID <[email protected]>
On May 25, 2005, at 9:07 PM, Alessandro Colomba wrote:
> Also, I found two strange (to me) legal sxml-match stylesheets:
>
> ;; a) infinite loop at runtime
> (sxml-match sxml
>   (,[x] x)))
>
> ;; b) runtime error "undefined variable x"
> (sxml-match sxml
>   (,[x] (guard (string? x)) x)))
>
> I cannot quite figure out the rationale behind the grammar[*]
> specifying that a node can be a catamorphism.

Fundamentally, the reason for the above is that it is consistent
with the grammar specified for the Indiana University "match"
s-expression pattern matcher.

At the time of implementing xml-match in WebIt! and the standalone
sxml-match, I contemplated prohibiting various cases in the grammar
for which catamorphisms obviously result in infinite recursion.
I am inclined to simply add checks to sxml-match to prohibit these
cases.

Jim



-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
online with coworkers and clients while avoiding the high cost of travel and
communications. There is no equipment to buy and you can meet as often as
you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click