Re: Quick question about str/join....

2011-01-04 Thread John Szakmeister
On Tue, Jan 4, 2011 at 8:29 PM, MiltondSilva wrote: > Again from inspection it seems the way it's implemented in contrib, > the code makes one pass. With (apply str (interpose sep coll)) you > make two, one to interpose the other to convert (seq->str). Well, interpose does return a lazy sequence,

Re: Quick question about str/join....

2011-01-04 Thread MiltondSilva
Again from inspection it seems the way it's implemented in contrib, the code makes one pass. With (apply str (interpose sep coll)) you make two, one to interpose the other to convert (seq->str). On Jan 5, 1:08 am, John Szakmeister wrote: > On Tue, Jan 4, 2011 at 8:01 PM, MiltondSilva wrote: > >

Re: Quick question about str/join....

2011-01-04 Thread John Szakmeister
On Tue, Jan 4, 2011 at 8:22 PM, Stuart Halloway wrote: > Several people had hands in that code, and the final result is all about > perf. Do not treat string.clj as a reference for idiomatic code. :-) That's what I suspected. :-) Thanks Stuart! -John -- You received this message because you

Re: Quick question about str/join....

2011-01-04 Thread Stuart Halloway
Several people had hands in that code, and the final result is all about perf. Do not treat string.clj as a reference for idiomatic code. :-) Stu > On Tue, Jan 4, 2011 at 8:01 PM, MiltondSilva wrote: >> I believe it's for performance reasons. Strings in java are immutable, >> so they use the St

Re: Quick question about str/join....

2011-01-04 Thread John Szakmeister
On Tue, Jan 4, 2011 at 8:01 PM, MiltondSilva wrote: > I believe it's for performance reasons. Strings in java are immutable, > so they use the StringBuilder(mutable) to achieve better performance. But str use StringBuilder too. Maybe it was better to avoid the extra call overhead? -John > On

Re: Quick question about str/join....

2011-01-04 Thread MiltondSilva
I believe it's for performance reasons. Strings in java are immutable, so they use the StringBuilder(mutable) to achieve better performance. On Jan 5, 12:18 am, John Szakmeister wrote: > I was looking at a commit that updated a docstring for str/join, which > enticed me to take a look at the impl

Quick question about str/join....

2011-01-04 Thread John Szakmeister
I was looking at a commit that updated a docstring for str/join, which enticed me to take a look at the implementation. I was kind of surprised to see that it wasn't: (apply str (interpose sep coll)) I'm just curious about the developer was thinking. Here's a link to the code: