I think this does what you want:

clj> (reductions + 0 [1 2 3])
(0 1 3 6)

On Monday, June 11, 2012 5:51:15 PM UTC-7, Andy C wrote:
>
> Hi, 
>
> I am looking for a way to express following function in Clojure: 
> scala> scanLeft(List(1,2,3))(0)(_ + _) 
> res1: List[Int] = List(0, 1, 3, 6) 
>
> Any insight? 
> Andy ... 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to