William James
6/6/2015 8:22:00 AM
Gabe Garza wrote:
> (defun sum-squares (list)
> (reduce #'+ (mapcar (lambda (a) (* a a)) list)))
Gauche Scheme:
(define (sum-squares numbers)
(fold (^(x acc) (+ acc (* x x))) 0 numbers))
Another way:
(use srfi-42 :only (sum-ec))
(define (sum-squares numbers)
(sum-ec (:list x numbers) (* x x)))
Another way:
(use srfi-42 :only (fold-ec))
(define (sum-squares numbers)
(fold-ec 0 (:list x numbers) (* x x) +))
--
"A concerted effort that aims at educating Swedes that immigrants are a
blessing to their country must be pursued," said Sahlin, stressing that her
compatriots must accept that the new Sweden is multi-cultural.... "Like it or
not, this is the new Sweden."
fjordman.blogspot.ca/2005/05/is-swedish-democracy-collapsing.html