Try reductions:

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

Dave

On Mon, Jun 11, 2012 at 5:51 PM, Andy Coolware <andy.coolw...@gmail.com> 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

-- 
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