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 <j...@szakmeister.net> wrote:
> On Tue, Jan 4, 2011 at 8:01 PM, MiltondSilva <shadowtr...@gmail.com> 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 Jan 5, 12:18 am, John Szakmeister <j...@szakmeister.net> wrote:
> >> 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:
> >>   
> >> <https://github.com/clojure/clojure/blob/f30995c86056959abca53d0ca35dc...>
>
> >> Thanks!
>
> >> -John
>
> > --
> > 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 first post.
> > To unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/clojure?hl=en

-- 
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 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to