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