Hi people!

Paul, yes! but...

The apply and str evaluations in (apply str (repeat n text))
are lazy?

I guess the result could be a big string.  Isn't it?

Angel "Java" Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

On Mon, Jun 28, 2010 at 5:31 PM, Paul Moore <[email protected]> wrote:

> On 28 June 2010 20:24, Angel Java Lopez <[email protected]> wrote:
> > Hi people!
> >
> > Any way to produce a lazy seq of chars, that prints as a string, based on
> > two parameters, n (number of repeats), text (text to repeat)?
> >
> > Then, something like
> >
> > (myrepeat 1000000 "superdupertext")
> >
> > could be implemented without a big processing or concatenation.
>
> The built in repeat is lazy:
>
> user=> (doc repeat)
> -------------------------
> clojure.core/repeat
> ([x] [n x])
>  Returns a lazy (infinite!, or length n if supplied) sequence of xs.
>
> Paul.
>
> --
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
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