Re: review the clojure.string code

2010-06-03 Thread Steve Molitor
Whoops should have said: upper-case-ay ower-case-lay eft-trim-lay ight-trim-ray Or something like that. Steve On Thu, Jun 3, 2010 at 9:16 AM, Steve Molitor wrote: > How about: > > pper-case-uay > ower-case-ay > eft-trim-lay > ight-trim-lay > >and so on... > > Steve > > > On

Re: review the clojure.string code

2010-06-03 Thread Steve Molitor
How about: pper-case-uay ower-case-ay eft-trim-lay ight-trim-lay and so on... Steve On Wed, Jun 2, 2010 at 10:49 AM, Tom Hickey wrote: > Including a space is correct when changing a string "to upper > case" (hence Java's toUpperCase), though no space would be fine there > as well.

Re: review the clojure.string code

2010-06-03 Thread B Smith-Mannschott
On Thu, Jun 3, 2010 at 11:03, Laurent PETIT wrote: > 2010/6/3 B Smith-Mannschott >> >> On Thu, Jun 3, 2010 at 09:31, Laurent PETIT >> wrote: >> > Hello, >> > >> > 2 quick remarks concerning the patch: >> > >> >   * type hints are written like #^String and not ^String >> >> not anymore: >> >> >>

Re: review the clojure.string code

2010-06-03 Thread Laurent PETIT
2010/6/3 B Smith-Mannschott > On Thu, Jun 3, 2010 at 09:31, Laurent PETIT > wrote: > > Hello, > > > > 2 quick remarks concerning the patch: > > > > * type hints are written like #^String and not ^String > > not anymore: > > > http://github.com/richhickey/clojure/commit/787938361128c2bc21ed896d

Re: review the clojure.string code

2010-06-03 Thread B Smith-Mannschott
On Thu, Jun 3, 2010 at 09:31, Laurent PETIT wrote: > Hello, > > 2 quick remarks concerning the patch: > >   * type hints are written like #^String and not ^String not anymore: http://github.com/richhickey/clojure/commit/787938361128c2bc21ed896dd4523651b59cb420 http://github.com/richhickey/cloju

Re: review the clojure.string code

2010-06-03 Thread Michael Gardner
On Jun 3, 2010, at 2:31 AM, Laurent PETIT wrote: > * why ltrim / rtrim , but upper-case / lower-case ? Why not ltrim / rtrim + > ucase / lcase , or left-trim right-trim + upper-case / lower-case ? Will > left-trim/right-trim be so often used that they must be shortened to > ltrim/rtrim (espec

Re: review the clojure.string code

2010-06-03 Thread Laurent PETIT
Hello, 2 quick remarks concerning the patch: * type hints are written like #^String and not ^String * why ltrim / rtrim , but upper-case / lower-case ? Why not ltrim / rtrim + ucase / lcase , or left-trim right-trim + upper-case / lower-case ? Will left-trim/right-trim be so often used that t

Re: review the clojure.string code

2010-06-02 Thread ataggart
+1 on uppercase / lowercase On Jun 2, 8:49 am, Tom Hickey wrote: > Including a space is correct when changing a string "to upper > case" (hence Java's toUpperCase), though no space would be fine there > as well. > > As a verb, "uppercase" (no space) is correct. So the function should > either mat

Re: review the clojure.string code

2010-06-02 Thread Tom Hickey
Including a space is correct when changing a string "to upper case" (hence Java's toUpperCase), though no space would be fine there as well. As a verb, "uppercase" (no space) is correct. So the function should either match java and be called to-upper-case or (preferably, IMO) simply be uppercase.

Re: review the clojure.string code

2010-05-30 Thread Stuart Halloway
But they can be separate words, and Java treats them so (.toUpperCase, .toLowerCase). Stu > Also, according to Merriam-Webster, uppercase and lowercase don't have > hyphens in them. > > RJ > > On May 30, 3:49 pm, Stuart Halloway wrote: >> I have been working on a branch [1] and haven't updat

Re: review the clojure.string code

2010-05-30 Thread Stuart Halloway
Steven, thanks for the detailed feedback! Responses inline: > Why do some of the functions use StringBuilder (no internal > synchronization) and some use StringBuffer (provides internal > synchronization). Using the latter is probably a mistake. Stuck with this thanks to the Java API: .appendRepl

Re: review the clojure.string code

2010-05-30 Thread Stuart Halloway
Thanks! Trying to pass through non-strings was overreaching. Ease of use first: the API should return immutable strings. If you really need to optimize more than this, roll your own. Stu > Type-hinting args as a CharSequence is a GoodThing; type-hinting that > you're returning a CharSequence wh

Re: review the clojure.string code

2010-05-30 Thread RJ
Also, according to Merriam-Webster, uppercase and lowercase don't have hyphens in them. RJ On May 30, 3:49 pm, Stuart Halloway wrote: > I have been working on a branch [1] and haven't updated the ticket yet [2]. > Given the number of diverse (and sometimes opposite!) opinions already > express

Re: review the clojure.string code

2010-05-30 Thread ataggart
Type-hinting args as a CharSequence is a GoodThing; type-hinting that you're returning a CharSequence when you're actually returning a String is not. I disagree with Steven that some functions should return the StringBuilder instance due to being type-hinted as CharSequence. CharSequence is barely

Re: review the clojure.string code

2010-05-30 Thread Steven E. Harris
Why do some of the functions use StringBuilder (no internal synchronization) and some use StringBuffer (provides internal synchronization). Using the latter is probably a mistake. The first function -- reverse -- uses StringBuilder#reverse() to reverse the character sequence in place, and then cal

review the clojure.string code

2010-05-30 Thread Stuart Halloway
I have been working on a branch [1] and haven't updated the ticket yet [2]. Given the number of diverse (and sometimes opposite!) opinions already expressed on this topic, I thought a little extra community review would be in order. David and I organized the work into several fairly small commit