Re: generating a list of random numbers

2010-07-28 Thread Sanel Zukan
> (repeatedly 100 #(rand-int 10)) Hm... on 1.1.: user=> (repeatedly 100 #(rand-int 10)) java.lang.IllegalArgumentException: Wrong number of args passed to: core$repeatedly (NO_SOURCE_FILE:0) user=> but, could be solved with: user=> (take 100 (repeatedly #(rand-int 10))) -- You received th

Re: generating a list of random numbers

2010-07-28 Thread Nikita Beloglazov
Hi, bOR_ Yes, there is easier variant: (repeatedly 100 #(rand-int 10)) On Wed, Jul 28, 2010 at 10:24 AM, bOR_ wrote: > Hi all, > > I have the nagging feeling that I'm missing a simple solution. Say I > want a list of a 100 rand-int 10 numbers. Currently, I create that by > doing (map (fn [_] (ra

Re: generating a list of random numbers

2010-07-28 Thread bOR_
Ah. A sneaky difference between repeat and repeatedly there then :). Good to remember! On Jul 28, 9:35 am, Laurent PETIT wrote: > Hi, > > You could do: > > (repeatedly 100 #(rand-int 10)) > > HTH, > > -- > Laurent > > 2010/7/28 bOR_ > > > > > Hi all, > > > I have the nagging feeling that I'm mis

Re: generating a list of random numbers

2010-07-28 Thread Michael Wood
On 28 July 2010 09:24, bOR_ wrote: > Hi all, > > I have the nagging feeling that I'm missing a simple solution. Say I > want a list of a 100 rand-int 10 numbers. Currently, I create that by > doing (map (fn [_] (rand-int 10)) (range 100)). Is there an easier > way? I think Laurent's answer is bet

Re: generating a list of random numbers

2010-07-28 Thread Laurent PETIT
Hi, You could do: (repeatedly 100 #(rand-int 10)) HTH, -- Laurent 2010/7/28 bOR_ > Hi all, > > I have the nagging feeling that I'm missing a simple solution. Say I > want a list of a 100 rand-int 10 numbers. Currently, I create that by > doing (map (fn [_] (rand-int 10)) (range 100)). Is th

generating a list of random numbers

2010-07-28 Thread bOR_
Hi all, I have the nagging feeling that I'm missing a simple solution. Say I want a list of a 100 rand-int 10 numbers. Currently, I create that by doing (map (fn [_] (rand-int 10)) (range 100)). Is there an easier way? -- You received this message because you are subscribed to the Google Groups