(defn combinations [& cs]
(reduce #(for [v %1 i %2] (conj v i)) [[]] cs))
Sunday, October 19, 2008
Clojure Golf: combinations (2)
This post has moved,
go to its new location
Subscribe to:
Post Comments (Atom)
When the pupil is ready to learn, a teacher will appear.
(defn combinations [& cs]
(reduce #(for [v %1 i %2] (conj v i)) [[]] cs))
No comments:
Post a Comment