Re: A style question
- From: Harald Hanche-Olsen <hanche@xxxxxxxxxxxx>
- Date: Wed, 28 Feb 2007 23:05:47 +0100
You want squiggles? How about
(format t "~&~:{ ~@[~A~]~@[~A~]~2:*~:[~:[~D~;~]~;~]~}~%"
(loop for n from 1 to 100
for fizz in '#3=(nil nil "Fizz" . #3#)
for buzz in '#5=(nil nil nil nil "Buzz" . #5#)
collect (list fizz buzz n)))
Or, if loop is for weenies, perhaps this one, with a few gratuitous
MAPs and NCONCs thrown in.
(format t "~&~:{ ~@[~A~]~@[~A~]~2:*~:[~:[~@[~C~]~C~;~]~;~]~}~%"
(cdr
(nconc
(map 'list
(lambda (ij f b) (cons f (cons b ij)))
(apply #'nconc
(map 'list
(lambda (i)
(map 'list
(lambda (j)
(list (if (eql i #\0) nil i) j))
#1="0123456789"))
#1#))
'#3=("Fizz" nil nil . #3#)
'#5=("Buzz" nil nil nil nil . #5#)))))
--
* Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
when there is no ground whatsoever for supposing it is true.
-- Bertrand Russell
.
- Follow-Ups:
- Re: A style question
- From: Harald Hanche-Olsen
- Re: A style question
- 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
- Re: A style question
- From: Richard M Kreuter
- Re: A style question
- From: Tim Bradshaw
- Re: A style question
- From: Richard M Kreuter
- Re: A style question
- From: Tim Bradshaw
- A style question
- Prev by Date: Re: Useless SBCL on Win32: memory problem
- Next by Date: Re: A style question
- Previous by thread: Re: A style question
- Next by thread: Re: A style question
- Index(es):
Relevant Pages
|