;; The quintessential interpose example:
user> (def my-strings ["one" "two" "three"])
user> (interpose ", " my-strings)
=> ("one" ", " "two" ", " "three")
user> (apply str (interpose ", " my-strings))
=> "one, two, three"
(defn interpose
"Returns a lazy seq of the elements of coll separated by sep"
{:added "1.0"}
[sep coll] (drop 1 (interleave (repeat sep) coll)))
Comments top
No comments for interpose. Log in to add a comment.