[racket-dev] `regexp-match**'

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sun Jun 5 09:09:00 EDT 2011

I don't get the 57+1 point, and I think it would make sense to extend
`regexp-match*' with an `#:extract' argument (or some other keyword)
whose value defaults to `car'.

At Sat, 4 Jun 2011 17:08:16 -0400, Eli Barzilay wrote:
> So the request to get subgroups from `regexp-match*' is not new, and
> since I've seen it twice in a week I'm going to add it.  What I'm
> thinking to do is some `regexp-match**' that takes another argument
> that is the function to apply on the usual results of `regexp-match'.
> Assuming that this is the first argument, `regexp-match*' could be
> defined simply as:
> 
>   (define (regexp-match* . xs)
>     (apply regexp-match** car xs))
> 
> but now you can use `values' and get the complete results from each
> match, or `cdr' and get just the subgroups, etc.
> 
> (I'll probably do some `regexp-match-positions**' too.)
> 
> The question is how to add that argument.  Adding a keyword to a
> function that already has 57 arguments looks odd; adding a 58th
> argument is bad for obvious reason that lead to keyword args in the
> first place; adding it first is the most convenient, but seems like it
> would be an odd extensions.
> 
> Opinions?
> 
> -- 
>           ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>                     http://barzilay.org/                   Maze is Life!
> _________________________________________________
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/dev


Posted on the dev mailing list.