Use keywords for loop specific symbols

This commit is contained in:
Marcus Kammer 2025-01-03 16:24:56 +01:00
parent 05fed06cc4
commit 2f01a098ea
Signed by: marcuskammer
GPG key ID: C374817BE285268F

View file

@ -10,12 +10,12 @@
(check-type data list)
(unless data (error "Empty DATA list."))
(let ((clean-data (remove-if (lambda (x) (or (> x 10) (< x 1))) data)))
(loop for score in clean-data
counting (>= score 9) into promoters
counting (<= score 6) into detractors
finally (return (list promoters
detractors
(length clean-data))))))
(loop :for score :in clean-data
:counting (>= score 9) :into promoters
:counting (<= score 6) :into detractors
:finally (return (list promoters
detractors
(length clean-data))))))
;;;
;;; CALCULATOR