On Wed, Jul 13, 2011 at 5:17 PM, Sam Ritchie <[email protected]> wrote: > Ken, that'll result in the original vector back out again. > (vec (take 3 (cycle [1 2 3]))) => [1 2 3]. > I think you mean: > (vec (take (* n (count xs)) (cycle xs))))
I wasn't using "n" to mean the number of repetitions of the xs but the total number of desired elements. One advantage of this method is if you want the first 20 elements from repeating a vector of seven items it won't set your hair on fire. :) -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language of a true hacker. Not as clumsy or random as C++; a language for a more civilized age. -- 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
