开发者

How does this code work? [duplicate]

This question already has an ans开发者_如何学Gower here: Closed 11 years ago.

Possible Duplicate:

weirdness in clojure map function

How does the following Clojure code work?

(def transpose (partial apply map list))

(println (transpose [[2 6 5] [1 0 9]]))


it equal to (map list [2 6 5] [1 0 9]), which in turn means (map #(list %1 %2) [2 6 5] [1 0 9]), the two vectors consumed at the same time, returns: ((2 1) (6 0) (5 9))

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜