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

How to sum a list?

10 views
Skip to first unread message

Robert L.

unread,
Sep 20, 2017, 2:52:59 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

--
Then the White farmers sought refuge in a police station. The blacks followed
them into the police station and seized them while the black policemen ...
refused to intervene.... Then the blacks stood ... Stevens beside the road and
killed him with shotgun blasts....
archive.org/details/PierceWilliamDr (HorrorInRhodesia)
0 new messages