(defun fizz-buzz (start end)
(loop for x from start to end do
(let ((3? (= (mod x 3) 0))
(5? (= (mod x 5) 0)))
(when 3? (format t "Fizz"))
(when 5? (format t "Buzz"))
(unless (or 3? 5?) (format t "~a" x))
(terpri))))
What does /b/ think?
Name:
Anonymous2011-09-01 12:08
>>27 In Python, concatenating strings in a loop is considered an anti-pattern merely because the popular implementation is incapable of producing good code in such a case.
You still have no future as a computer programmer. Now go run along and clean another toilet you mental midget.
Name:
Anonymous2011-09-01 12:12
>>27 The intractability or impossibility of static analysis in Python makes such optimizations difficult or impossible.
This is why we should use Common Lisp.