• Re: How to sum a list?

    From B. Pym@21:1/5 to Kenny Tilton on Thu Jul 3 11:45:15 2025
    XPost: comp.lang.scheme

    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)

    Gauche Scheme

    (use scheme.vector) ;; vector-fold

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

    Another way:

    (use gauche.sequence)
    (fold + 0 #(2 3 4))

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)