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

2011-06-04 Thread Eli Barzilay
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

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

2011-06-04 Thread Robby Findler
If you are going to make a new, more general function you could make all of the arguments keyword based. Robby On Saturday, June 4, 2011, 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

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

2011-06-04 Thread Carl Eastlund
Why does regexp-match** need to take this extra argument? Can't we just use map like normal? If we want users to process each match in turn, possibly to allow early garbage collection, it sounds like an in-regexp-matches sequence would be better. Carl Eastlund On Sat, Jun 4, 2011 at 5:08 PM, El

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

2011-06-04 Thread Eli Barzilay
50 minutes ago, Carl Eastlund wrote: > Why does regexp-match** need to take this extra argument? Can't we > just use map like normal? I can't parse this. > If we want users to process each match in turn, possibly to allow > early garbage collection, it sounds like an in-regexp-matches > sequenc

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

2011-06-04 Thread Eli Barzilay
50 minutes ago, Robby Findler wrote: > If you are going to make a new, more general function you could make > all of the arguments keyword based. Yeah, but then a name like `regexp-match**' isn't fitting, and I really don't want to start with some confusing synonyms. So while a keyworded interfac

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

2011-06-04 Thread Carl Eastlund
You wrote: (define (regexp-match* . xs) (apply regexp-match** car xs)) I'm asking why it's not just this instead: (define (regexp-match* . xs) (map car (apply regexp-match** xs)) Why does regexp-match** need to do the mapping? Carl Eastlund On Sat, Jun 4, 2011 at 7:17 PM, Eli Barzilay

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

2011-06-04 Thread Eli Barzilay
50 minutes ago, Carl Eastlund wrote: > You wrote: > > (define (regexp-match* . xs) >(apply regexp-match** car xs)) > > I'm asking why it's not just this instead: > > (define (regexp-match* . xs) > (map car (apply regexp-match** xs)) > > Why does regexp-match** need to do the mapping? Be

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

2011-06-05 Thread Matthew Flatt
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 >