[racket] regexp-replace* with input-port ==> Re: multi-replace function

From: YC (yinso.chen at gmail.com)
Date: Tue Dec 7 03:08:24 EST 2010

On Mon, Dec 6, 2010 at 11:49 PM, Eli Barzilay <eli at barzilay.org> wrote:

>
> Well, that would be an obvious issue...  It might be possible to do
> this if they're extended to get an output port too, something like:
>
>  (regexp-replace* #rx"foo" inp "bar" outp)
>
> doing the same thing as the loop that I wrote.


So sounds like it can be done then?  This will be a nice addition and make
the regexp lib interface more uniform when someone gets around to it.


> > But since the string & bytes variants all generate new output, that
> > will seem to be the same for input-port source anyways.
>
> (I didn't follow that.)


I just mean that (regexp-replace* #rx"foo" in "bar") can return bytes or
string or an input-port, instead of having to take in an output-port, if we
do not want to add a fourth param as you showed above.  But I like what you
have shown above as well.

Thanks,
yc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20101207/8fdf7a18/attachment.html>

Posted on the users mailing list.