I like it a lot. <br><div class="gmail_quote"><br>[...]<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
(string-split str [sep #px"\\s+"])<br>
Splits `str' on occurrences of `sep'. Unclear whether it should<br>
do that with or without trimming, which affects keeping a<br>
first/last empty part. [*1*] Possible solution: make it take a<br>
`#:trim?' keyword, in analogy to `string-normalize-spaces'. This<br>
would make `#t' the obvious choice for a default, which means that<br>
(string-split ",,foo, bar," ",") -> '("foo" " bar")<br></blockquote><div><br>A keyword might be a good idea indeed.<br> <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
(list-index list elt)<br>
Looks for `elt' in `list'. This is a possible extension for<br>
`racket/list' that would be kind of obvious with adding the above.<br>
[*3*] I'm not sure if it should be added, but IIRC it was<br>
requested a few times. If it does get added, then there's another<br>
question for how far the analogy goes: [*3a*] Should it take a<br>
start/end index too? [*3b*] Should it take a list of elements and<br>
look for a matching sublist instead (which is not a function that<br>
is common to ask for, AFAICT)?<br></blockquote><div><br>Or should it take a comparison operator (e.g., defaulting to equal?) ?<br>Maybe list-index could be simple (considering the list flat), and list-index* could return a list of positions in the sublists?<br>
E.g., (list-index* '(a (b (c d) e) f) 'c) -> '(1 1 0)<br>(list-index* '(a (b (c d) e) f) '(c d)) -> '(1 1)<br></div><div><br></div></div>Btw, from time to time I wish that `remove*' accepted a single element that is not a list. <br>
I find it a bit cumbersome and not good looking to wrap a single value in a (list ...).<br>Since modifying remove* would probably break a few things, maybe a remove+ ?<br><br>Laurent<br>