From Newsgroup: comp.lang.lisp
(defun avg (args)
(loop for x in args
for l upfrom 1
summing x into tot
finally (return (/ tot l))))
(define (avg xs)
(do ((sum 0 (+ (pop! xs) sum))
(i 0 (+ 1 i)))
((null? xs) (/ sum (max 1 i)))))
(avg '())
0
(avg '(2))
2
(avg '(2 3 4))
3
--
[T]he problem is that lispniks are as cultish as any other devout group and basically fall down frothing at the mouth if they see [heterodoxy].
--- Kenny Tilton
The good news is, it's not Lisp that sucks, but Common Lisp. --- Paul Graham --- Synchronet 3.21a-Linux NewsLink 1.2