[plt-scheme] match and xml structures

From: David Van Horn (dvanhorn at emba.uvm.edu)
Date: Wed Jul 16 12:05:02 EDT 2003

Matthew Flatt wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> At Tue, 15 Jul 2003 14:42:34 -0400, David Van Horn wrote:
>>However, structure subtypes still don't seem to match.
> Right. Unfortunately, we're stuck at this point.
> The problem is that unit signatures don't include information about
> subtypes, so `match' has no way to know about subtypes. 

Ah, I see now.  Units don't export syntax objects, which is how the 
structure information is conveyed.  Eg. `comment' is not bound in xml.ss.

Just a couple more comments...

I happen to come across what seems like another bug in match.

    (match '((a 1) (b 1))
      (((or ('a _) ('b _)) ..1)

    ;=> #t   Ok.

    (match '((a 1) (b 1))
      (((or ('a x) ('b x)) ..1)

    ;cdr: expects argument of type <pair>; given #f

And I was wondering if the grammar for match could be slightly extended.

I believe that (and pat1 ... patn) could be (and lvp1 ... lvpn), 
likewise for `or' and `not'.

This would allow patterns such as

   (or ('p x) ...
       ('q x) ...)

(BTW, the online and distributed documentation for version 204 is 
missing the pattern syntax image. 


Posted on the users mailing list.