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