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

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sat Jun 4 18:25:27 EDT 2011

If you are going to make a new, more general function you could make
all of the arguments keyword based.


On Saturday, June 4, 2011, Eli Barzilay <eli at barzilay.org> 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.