<br><br><div class="gmail_quote">On Thu, Apr 19, 2012 at 14:33, Matthew Flatt <span dir="ltr"><<a href="mailto:mflatt@cs.utah.edu">mflatt@cs.utah.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I agree with this: we should add `string-split', the one-argument case<br>
should be as Eli wrote,</blockquote><div><br>About this I'm not sure, as one cannot reproduce this behavior by providing an argument (or it could make the difference between string-as-not-regexps and regexps? Wouldn't this be different from other places?).<br>
It would then appear somewhat magical. To me the " " default splitter seems more intuitive.<br><br>Laurent<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
and the two-argument case should be as Laurent<br>
wrote. (Probably the optional second argument should be string-or-#f,<br>
where #f means to use #px"\\s+".)<br>
<div><div class="h5"><br>
At Thu, 19 Apr 2012 14:30:31 +0200, Laurent wrote:<br>
> (define (string-split str [sep #px"\\s+"])<br>
> > (remove* '("") (regexp-split sep str)))<br>
> ><br>
><br>
> Nearly, I meant something more like this:<br>
><br>
> (define (string-split str [splitter " "])<br>
> (regexp-split (regexp-quote splitter) str))<br>
><br>
> No regexp from the user POV, and much easier to use with little knowledge.<br>
</div></div>> _________________________<br>
> Racket Developers list:<br>
> <a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
</blockquote></div><br>