On Mon, Sep 6, 2010 at 9:12 PM, Ludovic Courtès <l...@gnu.org> 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!  :-)
>
>  http://git.sv.gnu.org/cgit/guile-rpc.git/tree/modules/rpc/compiler.scm#n312
>
> 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
win.

-- 
Alex

Reply via email to