要打印值,可以使用字符串连接符和序列。
(require '[clojure.math.combinatorics :as combo])
(require '[clojure.string :as s])
(doseq [l (combo/subsets [1 2 3])]
(println (s/join ",", l)))
如果你想要去除空集,请使用过滤器。
(doseq [l (filter (complement empty?)
(combo/subsets [1 2 3]))]
(println (s/join ",", l)))