On Thu, Jul 1, 2010 at 1:36 PM, Laurent PETIT <laurent.pe...@gmail.com>wrote:

> If you want to avoid at all cost the creation of intermediate Seq elements:
>
> (defn explode-string [^String string]
>  (loop [i (int 0) v (transient [])]
>    (if (== i (.length string))
>      (persistent! v)
>      (recur (inc i) (conj! v (.substring string i (inc i)))))))
>
> But do you really need a so much more complex version ?
>


If you think that one day (is it already the case in some branch?) map will
have chunky evaluation,
I am not sure this one is more efficient.

-- 
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