Normally in match...
> (match '(a b b b b b b a)
[`(,x ,y ... ,x) (list 'x: x 'y: y)])
'(x: a y: (b b b b b b))
> (match '(a b b b b b b d)
[`(,x ,y ... ,x) (list 'x: x 'y: y)]
[_ 'nope])
'nope
So far, so good.
However, in this case:
> (match '(a b b b b b b c)
[`(a ,x ... ,y ... ,x ... c) (list 'x: x 'y: y)])
'(x: (b b b b b b) y: ())
> (match '(a b b b b b b c)
[`(a ,x ... ,y ..1 ,x ... c) (list 'x: x 'y: y)])
'(x: (b b b b b) y: (b))
I am confused. Shouldn't the two instances of 'x ...' be the same?
In which case, in the first example, 'x' would be '(b b b) and 'y' would be
'(),
In the second 'x' would be '(b b) and 'y' would also be '(b b), no?
That's the way I understand it (and the way it works with most patterns
matchers I've seen).
What have I missed?
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.