Is it intentional that let-match binds the first of mvars to the match
object itself?
The documentation uses the example
(let-match (regexp-search date s) (whole-date month day year)
... body ...)
which indicates that the first of mvars (whole-date) probably should
be the whole string match, and the subsequent mvars the submatches.
But:
(let-match
(regexp-search (rx (submatch "foo") (submatch "bar")) "foobar")
(one two three four) ; mvars
(write one) (newline) ; body
(write two) (newline)
(write three) (newline)
(write four) (newline))
Gives the following output:
#{regexp-match}
"foobar"
"foo"
"bar"
The following was expected:
"foobar"
"foo"
"bar"
|