[Top][All Lists]

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

Re: ‘match’ and “k or more” patterns

From: Alex Shinn
Subject: Re: ‘match’ and “k or more” patterns
Date: Wed, 8 Sep 2010 11:18:18 +0900

On Mon, Sep 6, 2010 at 9:12 PM, Ludovic Courtès <address@hidden> wrote:
> Well, since there are only 9 of them, they could probably be implemented
> as special cases, with an augmented ‘match-gen-ellipses’, which would be
> told the minimum number of elements expected?

Oh, the Wright syntax limited you to 9 forms, so "..10" is illegal?

Then this could be done in pure syntax-rules.

>> Do you have any code which actually uses the ..k
>> patterns? :)
> I do!  :-)
> Well it uses only ‘..1’.  The same code would work with ‘..1’ replaced
> by ‘...’, but then errors in the input wouldn’t be detected as nicely.

"..1" is actually useful - it's the analog of "+" in regular
expressions, and allows simplifying many syntax-rules
patterns you see written (elt0 elt1 ...) as (elt ..1).  If
the elements are more complex patterns this is a big


reply via email to

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