Re: [racket-dev] `racket/string' extensions

2012-05-25 Thread Laurent
On Thu, May 24, 2012 at 10:45 PM, Eli Barzilay e...@barzilay.org wrote: (string-index str sub [start 0] [end (string-length str)]) Looks for occurrences of `sub' in `str', returns the index if found, #f otherwise. [*2*] I'm not sure about the name, maybe `string-index-of'

Re: [racket-dev] `racket/string' extensions

2012-05-24 Thread Eli Barzilay
About a month ago, Eli Barzilay wrote: [...] This is now almost completely implemented. If you have any comments on the below, now would be a good time. The two things that I didn't do yet are the following (I'm still not sure about the names and the functionality): (string-index str sub

Re: [racket-dev] `racket/string' extensions

2012-05-24 Thread J. Ian Johnson
I'm a bit surprised list-index doesn't take an equality function. -Ian - Original Message - From: Eli Barzilay e...@barzilay.org To: dev@racket-lang.org Sent: Thu, 24 May 2012 16:45:26 -0400 (EDT) Subject: Re: [racket-dev] `racket/string' extensions About a month ago, Eli Barzilay wrote

[racket-dev] `racket/string' extensions

2012-04-19 Thread Eli Barzilay
Sorry for the new thread, but this is a kind of a summary on the extensions that I think we're converging to, with a way to resolve the exact meaning of arguments. Please read through and reply if you see any problems with it. There are three specific questions, which are marked with

Re: [racket-dev] `racket/string' extensions

2012-04-19 Thread Laurent
I like it a lot. [...] (string-split str [sep #px\\s+]) Splits `str' on occurrences of `sep'. Unclear whether it should do that with or without trimming, which affects keeping a first/last empty part. [*1*] Possible solution: make it take a `#:trim?' keyword, in analogy to

Re: [racket-dev] `racket/string' extensions

2012-04-19 Thread namekuseijin
On Thu, Apr 19, 2012 at 1:28 PM, Eli Barzilay e...@barzilay.org wrote:  (list-index list elt)    Looks for `elt' in `list'.  This is a possible extension for    `racket/list' that would be kind of obvious with adding the above.    [*3*] I'm not sure if it should be added, but IIRC it was    

Re: [racket-dev] `racket/string' extensions

2012-04-19 Thread David Vanderson
Thank you so much for this. This was definitely one area of difficulty when I started using Racket for scripting. On 04/19/2012 09:28 AM, Eli Barzilay wrote: But to allow other uses, make these arguments a string *or* a regexp, where a regexp is taken as-is. This leads to another simplicity