Reputation: 105043
I have a sequence:
[a b c ...]
And a function (f x y)
. I want to get this:
(f c (f b (f a 1)))
Etc.. How to do this?
Upvotes: 5
Views: 107
Reputation: 45071
Reduce, with a small adaptation:
(reduce #(f %2 %1) 1 [a b c])
Upvotes: 11