[racket-dev] Are There More String Functions?

From: Eli Barzilay (eli at barzilay.org)
Date: Wed Apr 18 15:37:36 EDT 2012

Just now, Sam Tobin-Hochstadt wrote:
> 'trim' is used in lots of languages for this, and I think we should
> stick with that.

The issue is a name for the second function that normalizes spaces.

(And if you're saying that `trim' is doing both in lots of languages,
then that's wrong AFAICT.)


> On Apr 18, 2012 3:28 PM, "Eli Barzilay" <eli at barzilay.org> wrote:
> 
>     Just now, Matthias Felleisen wrote:
>     >
>     > On Apr 18, 2012, at 3:12 PM, Eli Barzilay wrote:
>     >
>     > >  `string-normalize-spaces', which takes a string and a regexp for the
>     > >  spaces, and turns all spaces into single ones.  Same principles as
>     > >  above.  This one is getting a `#:trim?' keyword that says whether
>     > >  spaces at the edges should be dropped (the default) or normalized.
>     > >
>     > >  BTW, I hate that name -- it makes the `string-' prefix looks even
>     > >  uglier...  Any suggestions for a better name?
>     >
>     >
>     > string-reduce
>     >
>     > ?
>    
>     That sounds like a kind of a `fold'...  (BTW, some names that I
>     considered are: `normalize-spaces', `compact-spaces',
>     `string-normalize'.  They all had problems.)
>    
>     --
>              ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>                        http://barzilay.org/                   Maze is Life!
> 

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the dev mailing list.