Re: Documentation of clojure.string/split is confusing

2021-01-13 Thread Oliver
appy new year, folks. >> >> (Might not be the best place to post this, but I failed to find a better >> one, please advise if there is. I've also tried to look for previous >> comments about this. If there are, then my Google-fu was simply too weak.) >> >

Re: Documentation of clojure.string/split is confusing

2021-01-12 Thread Peter Strömberg
>> (Might not be the best place to post this, but I failed to find a better >> one, please advise if there is. I've also tried to look for previous >> comments about this. If there are, then my Google-fu was simply too weak.) >> >> https://clojuredocs.org/clojure.stri

Re: Documentation of clojure.string/split is confusing

2021-01-12 Thread 'Alex Miller' via Clojure
is, but I failed to find a better > one, please advise if there is. I've also tried to look for previous > comments about this. If there are, then my Google-fu was simply too weak.) > > https://clojuredocs.org/clojure.string/split says: > -- > Usage: > (split s re) > (sp

Documentation of clojure.string/split is confusing

2021-01-12 Thread Oliver
Happy new year, folks. (Might not be the best place to post this, but I failed to find a better one, please advise if there is. I've also tried to look for previous comments about this. If there are, then my Google-fu was simply too weak.) https://clojuredocs.org/clojure.string/split says

Re: clojure.string unexpected behaviors

2016-06-23 Thread Elena Machkasova
t a string and should be distinguishable from an empty string > in many cases. > > We disagree on the degree of punning here ☺ I’m not asking for the change. > I understand why it is the way it is (I just don’t like it ☺). > > > blank? follows the rules of clojure.string you st

Re: clojure.string unexpected behaviors

2016-06-21 Thread Sean Corfield
understand why it is the way it is (I just don’t like it ☺).   > blank? follows the rules of clojure.string you stated above (other than it's > stated extension to also cover nil). Good point. Yes, I’m persuaded. Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ &q

Re: clojure.string unexpected behaviors

2016-06-21 Thread Alex Miller
s of inputs. > I'm not a fan of the word "garbage" in this case or "garbage in / garbage out". I think that implies a value judgement about both input and output that is incorrect here. "specified"/"unspecified" is much better. The clojure.string functions spec

Re: clojure.string unexpected behaviors

2016-06-21 Thread Sean Corfield
” input (not sets). This is the classic computer science “undefined” behavior that we see in many other languages, where the behavior is only defined for the specific types of inputs. I would _love_ all the clojure.string functions to be defined for nil as an input – since we have (str nil

Re: clojure.string unexpected behaviors

2016-06-21 Thread Alex Miller
There are some comments at the top of clojure.string (http://clojure.github.io/clojure/#clojure.string) about expected usage. In particular, you should expect all clojure.string functions to accept CharSequence (a parent interface of String, StringBuffer, and StringBuilder and return the same

clojure.string unexpected behaviors

2016-06-21 Thread Elena Machkasova
Greetings, I was looking at clojure.string functions, and noticed that some have unexpected (especially for less experienced programmers) behavior on non-string arguments. For instance, 'capitalize' applies toString to its argument, effectively making it possible to pass any type

Re: how do I clojure.string/replace regex characters? Escaping gives me StringIndexOutOfBoundsException

2014-08-05 Thread Vincent H
%)) #\* $))) = (f [:**username michael]) StringIndexOutOfBoundsException String index out of range: 1 java.lang.String.charAt (String.java:695) What am I doing wrong? If you use a regex as the second parameter of clojure.string/replace, then a $ character followed by a number in the third argument

Re: how do I clojure.string/replace regex characters? Escaping gives me StringIndexOutOfBoundsException

2014-08-05 Thread Andy Fingerhut
Or even more simply, since the thing you want to replace is a single character, you do not need a regex to match it, but can match a string that is not a regex at all, e.g.: (st/replace **username * $) The doc string for clojure.string/replace is fairly explicit on this. Andy On Mon, Aug 4

Re: how do I clojure.string/replace regex characters? Escaping gives me StringIndexOutOfBoundsException

2014-08-05 Thread Daniel Compton
: Or even more simply, since the thing you want to replace is a single character, you do not need a regex to match it, but can match a string that is not a regex at all, e.g.: (st/replace **username * $) The doc string for clojure.string/replace is fairly explicit on this. Andy On Mon

how do I clojure.string/replace regex characters? Escaping gives me StringIndexOutOfBoundsException

2014-08-04 Thread larry google groups
I'm working on a website with a frontender who asked to be able to save JSON maps that contain field names such as: $$hashKey : 00C The dollar signs are a violation of MongoDB limits on field names, so i need to convert to something else and then convert back. So I thought I would convert to

Re: another game of exploding heap, via clojure.string/split

2013-09-18 Thread Rob Lally
: I have just added some discussion of this on ClojureDocs.org for the function clojure.core/subs, and references to that discussion for several other Clojure functions that I am pretty sure are affected, e.g. re-find, re-seq, re-matches, clojure.string/split, replace, replace-first We know

Re: another game of exploding heap, via clojure.string/split

2013-09-17 Thread Andy Fingerhut
...@gmail.comwrote: I have just added some discussion of this on ClojureDocs.org for the function clojure.core/subs, and references to that discussion for several other Clojure functions that I am pretty sure are affected, e.g. re-find, re-seq, re-matches, clojure.string/split, replace, replace-first We

Re: another game of exploding heap, via clojure.string/split

2013-09-17 Thread Brian Craft
to that discussion for several other Clojure functions that I am pretty sure are affected, e.g. re-find, re-seq, re-matches, clojure.string/split, replace, replace-first We know with certainty that clojure.string/split is affected. Also, the OP's question about how to use tooling to track down similar

Re: another game of exploding heap, via clojure.string/split

2013-09-17 Thread Julien
, clojure.string/split, replace, replace-first We know with certainty that clojure.string/split is affected. Also, the OP's question about how to use tooling to track down similar leaks in the future does not appear to have been satisfactorily answered as of yet. cricket, cricket, cricket

Re: another game of exploding heap, via clojure.string/split

2013-09-17 Thread Andy Fingerhut
functions that I am pretty sure are affected, e.g. re-find, re-seq, re-matches, clojure.string/split, replace, replace-first We know with certainty that clojure.string/split is affected. Also, the OP's question about how to use tooling to track down similar leaks in the future does not appear

Re: another game of exploding heap, via clojure.string/split

2013-09-17 Thread Brian Craft
-seq, re-matches, clojure.string/split, replace, replace-first We know with certainty that clojure.string/split is affected. Also, the OP's question about how to use tooling to track down similar leaks in the future does not appear to have been satisfactorily answered as of yet. cricket

Re: another game of exploding heap, via clojure.string/split

2013-09-17 Thread Brian Craft
for several other Clojure functions that I am pretty sure are affected, e.g. re-find, re-seq, re-matches, clojure.string/split, replace, replace-first We know with certainty that clojure.string/split is affected. Also, the OP's question about how to use tooling to track down similar leaks

Re: another game of exploding heap, via clojure.string/split

2013-09-17 Thread Andy Fingerhut
, e.g. re-find, re-seq, re-matches, clojure.string/split, replace, replace-first We know with certainty that clojure.string/split is affected. Also, the OP's question about how to use tooling to track down similar leaks in the future does not appear to have been satisfactorily answered as of yet

Re: another game of exploding heap, via clojure.string/split

2013-09-14 Thread Alan Busby
, and references to that discussion for several other Clojure functions that I am pretty sure are affected, e.g. re-find, re-seq, re-matches, clojure.string/split, replace, replace-first We know with certainty that clojure.string/split is affected. Also, the OP's question about how to use tooling to track

Re: another game of exploding heap, via clojure.string/split

2013-09-14 Thread Brian Craft
...@gmail.comjavascript: wrote: I have just added some discussion of this on ClojureDocs.org for the function clojure.core/subs, and references to that discussion for several other Clojure functions that I am pretty sure are affected, e.g. re-find, re-seq, re-matches, clojure.string/split, replace, replace

another game of exploding heap, via clojure.string/split

2013-09-12 Thread Brian Craft
After working around the seq + closure = death problem, I still had a severe memory leak in my code, which took many hours to find. Holding a reference to a string returned by clojure.string/split is somehow retaining a reference to the original string. In my case I needed to hold the first

Re: another game of exploding heap, via clojure.string/split

2013-09-12 Thread Andy Fingerhut
you. Andy On Thu, Sep 12, 2013 at 9:08 AM, Brian Craft craft.br...@gmail.com wrote: After working around the seq + closure = death problem, I still had a severe memory leak in my code, which took many hours to find. Holding a reference to a string returned by clojure.string/split

Re: another game of exploding heap, via clojure.string/split

2013-09-12 Thread Andy Fingerhut
I have just added some discussion of this on ClojureDocs.org for the function clojure.core/subs, and references to that discussion for several other Clojure functions that I am pretty sure are affected, e.g. re-find, re-seq, re-matches, clojure.string/split, replace, replace-first http

Re: another game of exploding heap, via clojure.string/split

2013-09-12 Thread Cedric Greevey
, re-seq, re-matches, clojure.string/split, replace, replace-first We know with certainty that clojure.string/split is affected. Also, the OP's question about how to use tooling to track down similar leaks in the future does not appear to have been satisfactorily answered as of yet. -- -- You

Re: another game of exploding heap, via clojure.string/split

2013-09-12 Thread Brian Craft
problem, I still had a severe memory leak in my code, which took many hours to find. Holding a reference to a string returned by clojure.string/split is somehow retaining a reference to the original string. In my case I needed to hold the first column of each row in a tsv file that was 4G

Re: Should `nbsp;` be trimmed using `clojure.string/trim`? EOM

2013-08-12 Thread Tim Visher
Hi Andy, On Mon, Aug 12, 2013 at 12:17 AM, Andy Fingerhut andy.finger...@gmail.com wrote: Clojure's clojure.string/trim uses Java's String/trim, but clojure.string/triml and trimr use Java's Character/isWhitespace to determine which characters are white space to remove. CLJ-935 has

Should `nbsp;` be trimmed using `clojure.string/trim`? EOM

2013-08-11 Thread Tim Visher
Should `nbsp;` be trimmed using `clojure.string/trim`? EOM -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your

Re: Should `nbsp;` be trimmed using `clojure.string/trim`? EOM

2013-08-11 Thread Shantanu Kumar
On Monday, 12 August 2013 02:24:30 UTC+5:30, Tim Visher wrote: Should `nbsp;` be trimmed using `clojure.string/trim`? EOM `nbsp;` is the representation of an HTML entity, which is technically not whitespace. I guess `trim` should not remove it. Shantanu -- -- You received this message

Re: Should `nbsp;` be trimmed using `clojure.string/trim`? EOM

2013-08-11 Thread Christian Sperandio
nbsp; is closer an expression than a single character. A regexp replace should be more suitable. Le 11 août 2013 22:55, Tim Visher tim.vis...@gmail.com a écrit : Should `nbsp;` be trimmed using `clojure.string/trim`? EOM -- -- You received this message because you are subscribed

Re: Should `nbsp;` be trimmed using `clojure.string/trim`? EOM

2013-08-11 Thread yair
Visher tim.v...@gmail.com javascript: a écrit : Should `nbsp;` be trimmed using `clojure.string/trim`? EOM -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts

Re: Should `nbsp;` be trimmed using `clojure.string/trim`? EOM

2013-08-11 Thread Tim Visher
Sorry, I should have been more clear. In the following the space at the end of the string is a no break space and the first execution is under clojurescript, the second under clojure. user (clojure.string/trim 54 ) 54 bible-plan.mcheyne :cljs/quit :cljs/quit bible

Re: Should `nbsp;` be trimmed using `clojure.string/trim`? EOM

2013-08-11 Thread Andy Fingerhut
Clojure's clojure.string/trim uses Java's String/trim, but clojure.string/triml and trimr use Java's Character/isWhitespace to determine which characters are white space to remove. CLJ-935 has a suggested patch to make them all use Character/isWhitespace: http://dev.clojure.org/jira/browse

Re: clojure.string/capitalize API

2012-12-14 Thread Pierre Allix
I agree that with regards to 'least astonishment' the core fn should capitalize all characters. This is what I'd expect from a fn called 'capitalize'. There is already an upper-case function, thus capitalize should either capitalize the first character or all characters who begin a

clojure.string/capitalize API

2012-12-12 Thread Pierre Allix
Hello, The clojure.string/capitalize function is defined as follow: Converts first character of the string to upper-case, all other characters to lower-case. I think it does not follow principle of least astonishment. I would have expected to convert only the first character. Moreover

Re: clojure.string/capitalize API

2012-12-12 Thread Chris Ford
: Hello, The clojure.string/capitalize function is defined as follow: Converts first character of the string to upper-case, all other characters to lower-case. I think it does not follow principle of least astonishment. I would have expected to convert only the first character. Moreover

Re: clojure.string/capitalize API

2012-12-12 Thread Grant Rettke
On Wed, Dec 12, 2012 at 8:12 AM, Pierre Allix pierre.allix.w...@gmail.comwrote: I think it does not follow principle of least astonishment. I would have expected to convert only the first character. Moreover converting the other characters make the function almost useless, I for instance had

Re: clojure.string/capitalize API

2012-12-12 Thread Jim foo.bar
the above to capitalize which only capitalises the 1st charater... I agree that with regards to 'least astonishment' the core fn should capitalize all characters. This is what I'd expect from a fn called 'capitalize'. Jim On 12/12/12 14:12, Pierre Allix wrote: Hello, The clojure.string

Re: clojure.string/capitalize API

2012-12-12 Thread Marek Kubica
On Wed, 12 Dec 2012 09:44:28 -0600 Grant Rettke gret...@acm.org wrote: Fro that principle, who is the least astonished who is it based on? I jsut wanted to say, people coming e.g. from Python. But then I realized it does the same thing and afterwards I was enlightened that it doesn't matter

replace-first bug in clojure.string ?

2012-01-13 Thread Eric Fong
Clojure (require '(clojure [string :as string])) nil Clojure (string/replace-first a #b c) a Clojure (string/replace-first a #b (comp str last)) nil when pass a pattern and a function to the replace-first function, and the pattern doesn't match the string (first argument), replace-first will

Re: replace-first bug in clojure.string ?

2012-01-13 Thread Stuart Sierra
Known bug, fix forthcoming. http://dev.clojure.org/jira/browse/CLJ-753 -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with

clojure.string no namespace error

2011-10-18 Thread Omer Kudat
Hi all, I've started to teach myself clojure recently, so apologies for a potentially stupid question. I'm using clojure-1.3.0.jar, downloaded very recently. I would like to use clojure.string/split-lines, but I cannot access the namespace. I've tried: (import 'clojure.string) (import 'string

Re: clojure.string no namespace error

2011-10-18 Thread Philipp Meier
If you do a (require 'clojure.string) then all vars will be accessible as clojure.string/... e.g.clojure.string/split-lines . You can use use to import the vars into the current namespane: (use 'clojure.string) This wil make available all vars from clojure.string in you current namespace

Re: clojure.string no namespace error

2011-10-18 Thread Aaron Bedra
Here's an example from the REPL that should get you going: user = (require '[clojure.string :as str]) nil user= (str/split-lines foo\nbar\r\nbaz\n) [foo bar baz] Cheers, Aaron Bedra -- Clojure/core http://clojure.com On 10/18/2011 05:52 AM, Omer Kudat wrote: Hi all, I've started to teach

Re: clojure.string no namespace error

2011-10-18 Thread Omer Kudat
Thanks, I think I was trying to wrong thing (don't know why I was trying to use import rather than require). -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members

Re: clojure.string/replace-first return nil when not matched

2011-03-11 Thread Stuart Sierra
(require '[clojure.string :as str]) (str/replace-first abc def #ghi (fn [a] (str a a))) = nil That's a bug. Created http://dev.clojure.org/jira/browse/CLJ-753 http://dev.clojure.org/jira/browse/CLJ-753Thanks for the report. -Stuart Sierra clojure.com -- You received this message

clojure.string/replace-first return nil when not matched

2011-03-10 Thread Takahiro Hozumi
Hi, I have two questions about clojure.string/replace-first. 1. Is this expected behavior of replace-first? (require '[clojure.string :as str]) (str/replace-first abc def #ghi (fn [a] (str a a))) = nil I don't think so, because string / string argument version returns original string when

Re: clojure.string/replace-first return nil when not matched

2011-03-10 Thread Armando Blancas
))] (.appendReplacement m buffer rep) (.appendTail m buffer) (str buffer)) On Mar 10, 4:39 pm, Takahiro Hozumi fat...@googlemail.com wrote: Hi, I have two questions about clojure.string/replace-first. 1. Is this expected behavior of replace-first? (require

Re: clojure.string

2010-09-29 Thread Tim Olsen
On 09/24/2010 01:45 PM, Rasmus Svensson wrote: 2010/9/24 cej38 junkerme...@gmail.com: I noticed that clojure.string is not showing up on the API webpage, http://clojure.github.com/clojure/, is that an oversight? All the clojure.java.* namespaces and clojure.test are gone too... I don't

clojure.string

2010-09-24 Thread cej38
I noticed that clojure.string is not showing up on the API webpage, http://clojure.github.com/clojure/, is that an oversight? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts

Re: clojure.string

2010-09-24 Thread Rasmus Svensson
2010/9/24 cej38 junkerme...@gmail.com: I noticed that clojure.string is not showing up on the API webpage, http://clojure.github.com/clojure/, is that an oversight? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: clojure.string namespace missing from API page?

2010-08-20 Thread Alf Kristian Støyle
completely up-to-date with the 1.2 beta split, so for the moment just look at the master branch. I expect to have that fixed in the next few days. You are correct, clojure.string is not there. I'll get that added today. Thanks for catching it! Tom -- You received this message because you

Re: clojure.string namespace missing from API page?

2010-08-20 Thread Stuart Halloway
them completely up-to-date with the 1.2 beta split, so for the moment just look at the master branch. I expect to have that fixed in the next few days. You are correct, clojure.string is not there. I'll get that added today. Thanks for catching it! Tom -- You received this message

Re: clojure.string namespace missing from API page?

2010-07-19 Thread Btsai
-to-date with the 1.2 beta split, so for the moment just look at the master branch. I expect to have that fixed in the next few days. You are correct, clojure.string is not there. I'll get that added today. Thanks for catching it! Tom -- You received this message because you are subscribed

Re: clojure.string namespace missing from API page?

2010-07-18 Thread Tom Faulhaber
to have that fixed in the next few days. You are correct, clojure.string is not there. I'll get that added today. Thanks for catching it! Tom On Jul 17, 10:13 pm, Adrian Cuthbertson adrian.cuthbert...@gmail.com wrote: Yes, sorry, my post referred to the source, not the online doc API. Perhaps

Re: clojure.string namespace missing from API page?

2010-07-18 Thread Tom Faulhaber
clojure.string is now in for the master branch doc at http://clojure.github.com/clojure/ Separate 1.2 doc coming RSN. Tom On Jul 18, 11:10 am, Tom Faulhaber tomfaulha...@gmail.com wrote: The official doc for clojure and clojure-contrib have moved as well. They are now at: http

clojure.string namespace missing from API page?

2010-07-17 Thread Btsai
the clojure.string namespace. Did I miss something? Any help would be greatly appreciated. -Benny P.S. My apologies for the repeat question (I asked this question in the 1.2 beta release announcement thread as well), but I am leaning quite a bit on the API site as I continue to learn the functions built

Re: clojure.string namespace missing from API page?

2010-07-17 Thread Adrian Cuthbertson
of new namespaces.  I was able to find most of them (clojure.java.io, etc.) on the API site (http://richhickey.github.com/clojure/).  However, I could not find the clojure.string namespace.  Did I miss something?  Any help would be greatly appreciated. -Benny P.S.  My apologies for the repeat

Re: clojure.string namespace missing from API page?

2010-07-17 Thread Btsai
show up just fine there, which is why I'm confounded why clojure.string is not there. On Jul 17, 8:57 am, Adrian Cuthbertson adrian.cuthbert...@gmail.com wrote: Hi Benny, The 1.2 release source site has moved tohttp://github.com/clojure/ -Regards, Adrian On Sat, Jul 17, 2010 at 8:00 AM, Btsai

Re: clojure.string namespace missing from API page?

2010-07-17 Thread Adrian Cuthbertson
.  However, I was unable to find an online API there.  http://richhickey.github.com/clojure/ is the only online API I have seen.  And again, the other new 1.2 namespaces like clojure.java.io show up just fine there, which is why I'm confounded why clojure.string is not there. On Jul 17, 8:57 am

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

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

Re: review the clojure.string code

2010-06-03 Thread B Smith-Mannschott
On Thu, Jun 3, 2010 at 09:31, Laurent PETIT laurent.pe...@gmail.com 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

Re: review the clojure.string code

2010-06-03 Thread B Smith-Mannschott
On Thu, Jun 3, 2010 at 11:03, Laurent PETIT laurent.pe...@gmail.com wrote: 2010/6/3 B Smith-Mannschott bsmith.o...@gmail.com On Thu, Jun 3, 2010 at 09:31, Laurent PETIT laurent.pe...@gmail.com wrote: Hello, 2 quick remarks concerning the patch:   * type hints are written like

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 thic...@gmail.com wrote: Including a space is correct when changing a string to upper case (hence Java's toUpperCase), though no space would be fine

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 stevemoli...@gmail.comwrote: How about: pper-case-uay ower-case-ay eft-trim-lay ight-trim-lay and so on...

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-06-02 Thread ataggart
+1 on uppercase / lowercase On Jun 2, 8:49 am, Tom Hickey thic...@gmail.com 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

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

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

Re: review the clojure.string code

2010-05-30 Thread ataggart
clojure.string function since the very first usage of a CharSequence is always to call .toString() on it. I'd go the other way and document functions as returning a String, and type-hinting them as such. This also has practical effects: user= (defn ^CharSequence reverse [^CharSequence s

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 stuart.hallo...@gmail.com 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!)

Re: review the clojure.string code

2010-05-30 Thread Stuart Halloway
to be useful (which is precisely what StringBuilder's constructor does anyway). Further, any purported performance benefit from getting the mutable object back is lost if/when it is passed to another clojure.string function since the very first usage of a CharSequence is always to call .toString

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:

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 stuart.hallo...@gmail.com wrote: I have been working on a branch [1]