我有這樣過濾Clojure中
(def invoice
{:productId ["001" "002" "003" "004" "005" "006" "007" "008" "009" "010"],
:price ["50" "60" "70" "50" "40" "45" "55" "90" "50" "70"],
:quantity ["0" "0" "1" "2" "0" "0" "0" "0" "0" "1"]})
地圖如何過濾所以它只能說明產品id其中數量爲1個或更多?
我已經嘗試過做這樣
(filter (> (invoice :quantity %) 1) (map list (invoice :price) (invoice :quantity) (invoice :productid))
,但它不工作
地圖調用可能是'(地圖列表((juxt:price:quantity:productId)invoce))' – noisesmith 2014-11-02 18:33:42
@noisesmith ITYM'(應用地圖列表((juxt ...)...))''。 – amalloy 2014-11-04 05:20:27