Try this.
user> (def xy [:x1 :y1 :x2 :y2 :x3 :y3])
(as-> xy _
(partition 2 _)
(interleave _ [:z1 :z2 :z3])
(flatten _))
#'user/xy
(:x1 :y1 :z1 :x2 :y2 :z2 :x3 :y3 :z3)
user>
(as-> xy _
(partition 2 _)
(interleave _ [:z1 :z2 :z3])
(flatten _))
#'user/xy
(:x1 :y1 :z1 :x2 :y2 :z2 :x3 :y3 :z3)
user>
27.06.2013, 19:55, "Paul Meehan" <paulchristophermee...@gmail.com>:
Hi,--
Given a sequence (x1, y1, x2, y2, x3, y3,...)
and another (z1, z2, z3, ...)
I want to interleave such that I get a sequence
(x1, y1, z1, x2, y2, z2, x3, y3, z3, ...)
What's the most succinct way to achieve this?
thanks
Paul--
--
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
Note that posts from new members are moderated - please be patient with your first post.
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
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
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
Note that posts from new members are moderated - please be patient with your first post.
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
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.