Seems like shuffle should be part of the core or in the contrib.  Is there a
reason why it's not?

On Mon, Dec 1, 2008 at 9:55 PM, Timothy Pratley <[EMAIL PROTECTED]>wrote:

>
>
> http://groups.google.com/group/clojure/browse_thread/thread/180842eb58c58370/0e19ab338452c64f?lnk=gst&q=shuffle#0e19ab338452c64f
> The recommendation was to use java.util.Collections/shuffle and an
> example was given:
>
> (defn shuffle [coll]
>  (let [l (java.util.ArrayList. coll)]
>    (java.util.Collections/shuffle l)
>    (seq l)))
>
> user=> (shuffle [1 2 3 4 5])
> (4 2 1 5 3)
>
> On Dec 2, 3:28 pm, "Brian Doyle" <[EMAIL PROTECTED]> wrote:
> > Is there a function that takes a collection and randomizes, or shuffles,
> the
> > items?
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to