From Newsgroup: comp.lang.lisp
Another friend of mine commenting on the same FizzBuzz thread supplied
the following Python code. It certainly is concise:
for i in xrange(1,101):
print(str(i), "Fizz", "Buzz", "FizzBuzz")[(i%3==0)|(i%5==0)<<1]
Gauche Scheme
(use srfi-42) ;; do-ec looping macro.
(define (z? n) (if (= 0 n) 1 0))
(define % mod)
(do-ec (: i 1 101)
(print (~ `(,i Fizz Buzz FizzBuzz)
(+ (z? (% i 3)) (* (z? (% i 5)) 2)))))
After removing unnecessary blanks, it's shorter than the
Python version.
--
[T]he problem is that lispniks are as cultish as any other devout group and basically fall down frothing at the mouth if they see [heterodoxy].
--- Kenny Tilton
The good news is, it's not Lisp that sucks, but Common Lisp. --- Paul Graham --- Synchronet 3.21a-Linux NewsLink 1.2