Re: Random elements

2009-02-12 Thread Jason Wolfe
On Feb 11, 4:06 pm, Phil Hagelberg wrote: > I think that the bike shed should definitely be red. I hadn't heard that one before :) Issue here: http://code.google.com/p/clojure-contrib/issues/detail?id=29 -Jason --~--~-~--~~~---~--~~ You received this message b

Re: Random elements

2009-02-11 Thread Phil Hagelberg
Jason Wolfe writes: > OK, fine. Any objections to "shuffle" and "rand-elt", to parallel "rand-int"? I think that the bike shed should definitely be red. =) -Phil (http://en.wikipedia.org/wiki/Color_of_the_bikeshed) --~--~-~--~~~---~--~~ You received this mes

Re: Random elements

2009-02-11 Thread Jason Wolfe
OK, fine. Any objections to "shuffle" and "rand-elt", to parallel "rand-int"? On Feb 11, 2009, at 3:42 PM, Jeffrey Straszheim wrote: > "shuffle" seems perfectly fine. We *know* you aren't modifying it > in place, after all. > > Is there any reason we can't name random-element something lik

Re: Random elements

2009-02-11 Thread Jeffrey Straszheim
"shuffle" seems perfectly fine. We *know* you aren't modifying it in place, after all. Is there any reason we can't name random-element something like random-elem ? I think that is a fine compromise. On Wed, Feb 11, 2009 at 6:37 PM, Jeff Valk wrote: > > - Original Message - > From: Ph

Re: Random elements

2009-02-11 Thread Jeff Valk
- Original Message - From: Phil Hagelberg Sent: Wednesday 11 February 2009 13:16 > > Jason Wolfe writes: > > >> Would you consider changing the names of these 2 functions ? > >> > >> random-permutation -> shuffle > >> random-element -> one-of > >> > >> Shorter names are a trademark of

Re: Random elements

2009-02-11 Thread Phlex
Jason Wolfe wrote: > You're right, they should probably live in seq_utils.clj instead. > I'll post an issue to move them. > > If anyone has strong feelings about names, now would be a good time to > air them. My inclination is to leave the names as they are now; while > "shuffle" is the na

Re: Random elements

2009-02-11 Thread Jason Wolfe
You're right, they should probably live in seq_utils.clj instead. I'll post an issue to move them. If anyone has strong feelings about names, now would be a good time to air them. My inclination is to leave the names as they are now; while "shuffle" is the name for the Java "random-permut

Re: Random elements

2009-02-11 Thread bOR_
I was a bit surprised that random-permutation is in lazy-seqs.. there doesn't seem to be much lazy about it, right? It is just java's shuffle. On Feb 11, 8:16 pm, Phil Hagelberg wrote: > Jason Wolfe writes: > >> Would you consider changing the names of these 2 functions ? > > >> random-permutat

Re: Random elements

2009-02-11 Thread Phil Hagelberg
Jason Wolfe writes: >> Would you consider changing the names of these 2 functions ? >> >> random-permutation -> shuffle >> random-element -> one-of >> >> Shorter names are a trademark of clojure. >> "one-of" was taken straight from paip =) > > I'd be OK with shuffle, I guess, but I don't know if

Re: Random elements

2009-02-11 Thread Jason Wolfe
> Would you consider changing the names of these 2 functions ? > > random-permutation -> shuffle > random-element -> one-of > > Shorter names are a trademark of clojure. > "one-of" was taken straight from paip =) I'd be OK with shuffle, I guess, but I don't know if one-of is descriptive enough

Re: Random elements

2009-02-11 Thread Jeffrey Straszheim
I can see arguments either way. Certainly for the core library, short names are a plus. We don't want to litter our code with (get-first-element-of-seq x), but for less common routines from the libraries, the longer names may help readability a lot. On Wed, Feb 11, 2009 at 6:46 AM, Phlex wrote:

Re: Random elements

2009-02-11 Thread Phlex
Jason Wolfe wrote: > Not yet, but perhaps soon. Code is here: > > http://code.google.com/p/clojure-contrib/issues/detail?id=8 > > -Jason > Would you consider changing the names of these 2 functions ? random-permutation -> shuffle random-element -> one-of Shorter names are a trademark of c

Re: Random elements

2009-02-07 Thread Jason Wolfe
Not yet, but perhaps soon. Code is here: http://code.google.com/p/clojure-contrib/issues/detail?id=8 -Jason On Feb 7, 8:51 am, Jeffrey Straszheim wrote: > > Is there a function, perhaps in contrib somewhere, when given a collection, > returns a single random element? > --~--~-~--~--

Random elements

2009-02-07 Thread Jeffrey Straszheim
Is there a function, perhaps in contrib somewhere, when given a collection, returns a single random element? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloj