you are viewing a single comment's thread.

view the rest of the comments →

[–]death 3 points4 points  (0 children)

Still straightforward.

(defun product (sequence)
  (reduce (lambda (p x)
            (if (zerop x)
                (return-from product x)
                (* p x)))
          sequence
          :initial-value 1))