2 ms·
Common Lisp code basically equivalent to that first "trivial" Clojure implementation (WARNING: untested, may consist entirely of bugs): (defun factors (n)
by gjm11 14y ago
Common Lisp code basically equivalent to that first "trivial" Clojure implementation (WARNING: untested, may consist entirely of bugs):
(defun factors (n)
(loop for r upfrom 1 to n when (zerop (remainder n r)) collect r))
Clojure doesn't have much advantage in conciseness over CL here. It's just a matter of what approach the contributor chose to use.