thx, I see it now.
--
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,
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] = L
Try reductions:
user=> (reductions + 0 [1 2 3])
(0 1 3 6)
Dave
On Mon, Jun 11, 2012 at 5:51 PM, Andy Coolware 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,
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 grou