Re: A style question
- From: Dan Bensen <randomgeek@xxxxxxxxxxxxxx>
- Date: Tue, 27 Feb 2007 22:42:10 -0600
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
.
- References:
- A style question
- From: job-271842874
- Re: A style question
- From: Paul Wallich
- A style question
- Prev by Date: Re: Lisp Syntax - functions versus data
- Next by Date: Re: A style question
- Previous by thread: Re: A style question
- Next by thread: Re: A style question
- Index(es):