Thanks Eli. I'm happy you recognize the issue.<br><br>I did write my own string-trim-both function using Racket's regexp as follows:<br><br> (define (string-trim-both string)<br> (cadr (regexp-match #px"[\\s]*(\\S+)[\\s]*" string)))<br>
<br>May not be the best, but it works. Even though it's easy to implement, my issue was why it wasn't included. I guess I'm just used to such utilities functions being provided for free in the language I usually work in: Ruby. I was surprised that I had to either 1) roll my own, or 2) require the srfi-13.<br>
<br>Thanks for you help.<br><br clear="all">--<br>Chad<br><br>
<br><br><div class="gmail_quote">On Wed, May 9, 2012 at 11:42 AM, Eli Barzilay <span dir="ltr"><<a href="mailto:eli@barzilay.org" target="_blank">eli@barzilay.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">30 minutes ago, Chad Albers wrote:<br>
> I'm having a long running discussion with my colleagues about the<br>
> practically of scheme. I've argued that it is, and using Racket<br>
> Scheme to prove my point. However, on the other side of the debate,<br>
> I've noticed that Racket's string API is missing what I consider to<br>
> be a extremely practical procedure - string-trim. This procedure is<br>
> actually in srfi 13. While I can 'require' srfi13, I can't import<br>
> it as is, because sfri-13's procedures overlap Racket's string<br>
> procedures. I believe Racket's require feature allows me to just<br>
> import those procedures I need from srfi 13, but I find that kind of<br>
> awkward.<br>
><br>
> My question is, then, why would such a practical procedure missing<br>
> from Racket's string API?<br>
<br>
</div></div>In no particular order:<br>
<br>
* If two libraries provide the same name, you'd only run into problems<br>
if you `require' both -- otherwise, as Laurent showed, there<br>
shouldn't be any problems. If you do need to require both, then you<br>
can use a prefix or grab only the functionality that you need.<br>
<br>
* I don't see a big meta point about the practicality of Racket<br>
("Scheme" is trickier to talk about) -- we did have regexp<br>
operations for a long time now, and as any Perl hacker knows, you<br>
don't need anything more... But more seriously it definitely means<br>
that practicality is important.<br>
<br>
* The particular functionality that `string-trim' provides is one that<br>
can easily be done using regexps. This is why it wasn't an urgent<br>
addition. That's not to say that it's not needed -- and in fact<br>
this exact point came up recently -- it's just that if the main goal<br>
is to provide some simpler interface than regexps, then it's not<br>
clear how such an interface should look.<br>
<br>
* As a result of the recent discussion, I've added it, and it will be<br>
included in the next release. Also, it just happens that you wrote<br>
this email just when I was working on that exact function. (We had<br>
talked about the general interface to these functions and reached<br>
some conclusions that slightly change the way it's implemented.)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:<br>
<a href="http://barzilay.org/" target="_blank">http://barzilay.org/</a> Maze is Life!<br>
</font></span></blockquote></div><br>