Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个序列:
[a b c ...]
和一个功能(f x y)。我想得到这个:
(f x y)
(f c (f b (f a 1)))
等等..如何做到这一点?
减少,稍作调整:
(reduce #(f %2 %1) 1 [a b c])
(reduce (fn [acc x] (f x acc)) 1 [a b c d])