• Re: newbie asks: why CL rather than scheme?

    From B. Pym@21:1/5 to K. M. Pitman on Mon Jun 23 13:10:25 2025
    K. M. Pitman wrote:

    but instead of the LOOP version above you would probably write:

    (define (add-up number-list)
    (let continue ((remaining-items number-list) (sum-so-far 0))
    (if (null? remaining-items)
    sum-so-far
    (add-up (cdr remaining-items)
    (+ sum-so-far (car remaining-items))))))

    Wrong. You didn't even use "continue". Understand?

    Gauche Scheme

    (do ((sum 0 (+ sum (pop! nums))))
    ((null? nums) sum))

    Another way.

    (use srfi-42 :only (sum-ec))

    (define (add-up number-list)
    (sum-ec (:list x number-list) x))

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