Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

vector sum

28 views
Skip to first unread message

Robert L.

unread,
Sep 20, 2017, 2:54:22 AM9/20/17
to
Kenny Tilton wrote:

> Geoffrey King wrote:
> > (apply #'+ '( 1 2 3))
>
> True enough, but the OP asked about a vector.
>
> (loop for x across #(1 2 3) summing x)


(require srfi/43) ; vector functions

(vector-fold + 0 #(2 3 4))

===>
12

In Forth?

--
[E]verything that happens in the world is for the benefit of the Jewish
People.... G-D ... created the world for the sake of the Jewish People, and it
is our responsibility to implement the Torah---absolute morality and the
blueprint of creation---in it.
www.IsraelNationalNews.com/Articles/Article.aspx/2125#.UUnBZxx4xn8
0 new messages