juxt内で使用する関数のリストを定義したいと思いますが、実装には問題があります。相続人clojure、関数のリストを使用
私が何をしたいの例:
(defn sin [n] (Math/sin n))
(defn cos [n] (Math/cos n))
((juxt sin cos) 4)
>> [-0.7568024953079282 -0.6536436208636119]
は今の代わりに((juxt sin cos) 4)
を言って、私は (def trig [sin cos])
((juxt trig) 4)
を言うことを好むだろう。私は((apply juxt trig) 4)
といくつかの他のものを試みたが、何も固執していないようだ。ありがとう!
thx ...次回はチェックreplがきれい、教訓 – ChrisR