--- Revision None +++ Revision 343130363934 @@ -0,0 +1,7 @@ +(fn combine [c w] ; combine a word with a collection in every possible way + (for [x (range (inc (count c)))] + (let [[c1 c2] (split-at x c)] + (concat c1 [w] c2)))) + +; usage +(reduce #(mapcat (fn [c] (combine c %2)) %) [[]] s)