fork download
  1.  
  2. (defun average (&rest parameters)
  3. (if parameters
  4. (let ((accum
  5. (reduce #'(lambda (state value)
  6. (list (+ (first state) value)
  7. (1+ (second state))))
  8. parameters
  9. :initial-value (list 0 0))))
  10. (/ (first accum) (second accum)))
  11. 0))
  12.  
  13. (format t "~a~%" (average 2 4 6))
  14.  
Success #stdin #stdout 0.01s 10512KB
stdin
Standard input is empty
stdout
4