0
(defn coord-pairs [coords]
(for [number2 coords]
(for [number coords]
(vector (get coords number2) number)))
)
(([0 0] [0 1]) ([1 0] [1 1]))
我要输出到像
[[0 0] [0 1] [1 0] [1 1]]
(defn coord-pairs [coords]
(for [number2 coords]
(for [number coords]
(vector (get coords number2) number)))
)
(([0 0] [0 1]) ([1 0] [1 1]))
我要输出到像
[[0 0] [0 1] [1 0] [1 1]]
队列给你的输出
#(mapv vec (partition 2 (flatten %)))
或
#(vec (apply concat %))
我不太确定你的代码的意图,但...
(fn [coords] (vec (for [x coords y coords] [(get coords x) y])))