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