(defun update-score (old-score new-value) (mod (+ old-score new-value))) (defun score (data) (let* ((n (length data)) (v (make-array (1+ n)))) ;; Store the data in V (replace v data) ;; Store the initial score 0 (setf (aref v n) 0) ;; Update the score for all elements of DATA. (loop :for x :across data :do (setf (aref v n) (update-score (aref v n) x))) ;; Return V. v))