Re: A style question
- From: Barry Fishman <bfishman@xxxxxxxxxxxx>
- Date: Wed, 28 Feb 2007 16:05:19 GMT
"Tim Bradshaw" <tfb+google@xxxxxxxx> writes:
Incidentally, I'm deeply disappointed in the quality of answers in
this thread. In the elder days there would have been at least a few
followups showing how to do this in the proper "FORMAT string
indistinguishable from line noise" way. No true CL programmer ever
uses any other construct when the problem can be solved with a
combination of FORMAT, LOOP & GO (FORMAT being always preferable,
obviously). There may yet be those reading cll who know this, though
I suspect they have all gone into the west now.
I'm not a good practitioner of FORMAT, but there needs to be at least
one FORMAT solution presented.
(defun fizz-buzz (n)
(loop for i from 1 to n do
(format t "~[~d~;Fizz~;Buzz~;FizzBuzz~]~%"
(+ (if (zerop (mod i 3)) 1 0)
(if (zerop (mod i 5)) 2 0))
i)))
--
Barry Fishman
.
- References:
- A style question
- From: job-271842874
- Re: A style question
- From: Frank Buss
- Re: A style question
- From: job-271842874
- Re: A style question
- From: Tim Bradshaw
- A style question
- Prev by Date: Re: A style question
- Next by Date: Re: Lisp as an ODBC data source
- Previous by thread: Re: A style question
- Next by thread: Re: A style question
- Index(es):
Relevant Pages
|
|