(ns for-clojure.problem59)
(defn juxtaposition
[& fns]
(fn [& xs]
(into [] (map #(apply % xs) fns))))
(= [21 6 1] ((juxtaposition + max min) 2 3 5 1 6 4))
(= ["HELLO" 5] ((juxtaposition #(.toUpperCase %) count) "hello"))
(= [2 6 4] ((juxtaposition :a :c :b) {:a 2, :b 4, :c 6, :d 8 :e 10}))
4clojure第59个问题:创建自己的juxt
最新推荐文章于 2024-01-02 08:59:33 发布