> Why "presumably with side effects?"Otherwise you would use repeat. A pure
 function returns the same value every time, so there is no reason to call
it repeatedly.

Joshua

On Tue, Mar 24, 2009 at 10:04 AM, Paul Drummond <paul.drumm...@iode.co.uk>wrote:

>
> 2009/3/23 Krešimir Šojat <kso...@gmail.com>:
> > (rand-int 49) will produce one integer, and repeat will repeat it 10
> > times, that is why you see same number repeated.
>
> How embarrassing!
>
> As soon as I switched my machine off last night I realised rand-int
> was only being called once -  of course it was!
>
> I did consider 'repeatedly' but I couldn't get it to work for some
> reason - thank you for showing me how to use it.  Also, I was put off
> from using it when I read its doc-string which says:
>
> "Takes a function of no args, presumably with side effects, and
> returns an infinite lazy sequence of calls to it"
>
> Why "presumably with side effects?"
>
> Cheers,
> Paul.
> --
> Iode Software Ltd, registered in England No. 6299803.
>
> Registered Office Address: 12 Sancroft Drive, Houghton-le-Spring, Tyne
> & Wear, DH5 8NE.
>
> This message is intended only for the use of the person(s) ("the
> intended recipient(s)") to whom it is addressed. It may contain
> information which is privileged and confidential within the meaning of
> applicable law. If you are not the intended recipient, please contact
> the sender as soon as possible. The views expressed in this
> communication may not necessarily be the views held by The Company.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to