我有这样过滤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