On 12/14/2010 01:58 PM, Jim Wise wrote:
> what else should I be looking at?  What other scheme implementations
> provide pattern matching support?

There is SRFI 16's case-lambda, but it's pretty simple.

SRFI 51's rest-values is also relevant.

I'd like the syntax for lambda to be:

   (lambda <pattern> <body>)

That means that if R7RS supports optional arguments then the following
(or something functionally equivalent) should be a valid <pattern>:

   (a b #!optional c (d 10))

or even:

   ((a b #!optional c) #!optional (d #f))

This matches either a 1- or a 2-element list, where the first car
most be a 2- or a 3-element list.

Not that such functionality is required for R7RS - just that we should
keep in mind that a "list-pattern" is not just a "list of patterns".

Also, a question to ponder: For implementations that provide some kind of
abstract "sequence" type that is (at least) a superset of both list and 
vector:
They might want to allow a list pattern to match either a sequence or 
vector.
Not perhaps directly relevant to R7RS standardization, unless we're 
considering
abstract sequences types for R7RS, but note that is a direction some of us
might like to move towards.
-- 
        --Per Bothner
[email protected]   http://per.bothner.com/

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to