D o you want this? user=> (def x (interleave (iterate inc 1) (repeat 0))) #'user/x user=> (take 10 x) (1 0 2 0 3 0 4 0 5 0)
2012/4/10 Andrew <[email protected]> > Given a lazy sequence of numbers is there a way to interleave a constant > and get another lazy sequence? Say the first sequence is 1 2 3 4 ... I'd > like the second sequence to be 1 0 2 0 3 0 4 0 .... > > Thanks in advance! > > -- > 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 -- 庄晓丹 Email: [email protected] [email protected] Site: http://fnil.net Twitter: @killme2008 -- 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
