Re: A style question



Paul Wallich wrote:
In both cases, what the local variables add in supposed elegance seems to me lost by the clunkiness of setting them in the first place I'd probably brute-force the problem with a simple cond

You can eliminate variables and repetition by making the string
do double duty:

(let ((str (concatenate 'string
""
(if (zerop (mod n 3)) "fizz" "")
(if (zerop (mod n 5)) "buzz" ""))))
(write-line
(if (string= str "") (format nil "~D" n) str)))

--
Dan
www.prairienet.org/~dsb
.