Re: cl-quiz



Ari Johnson <iamtheari+usenet@xxxxxxxxx> writes:
"Geoffrey Summerhayes" <sumrnot@xxxxxxxxxxxxxxxxx> writes:

(format nil "~r ~a~:2*~P" 1 "apricot")

(format nil "~r ~a~2:*~P of beer on the wall" 99 "bottle")

Transpose the 2 and colon. Of course, #'format doesn't seem to be
smart enough to talk about puppies or children. ;)

Something can be done:

(dotimes (i 5)
(format t "~D child~:*~[ren~;~:;ren~] & ~:*~D pupp~:*~[ies~;y~:;ies~]~%" i))

0 children & 0 puppies
1 child & 1 puppy
2 children & 2 puppies
3 children & 3 puppies
4 children & 4 puppies

--
__Pascal Bourguignon__ http://www.informatimago.com/
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we. -- Georges W. Bush
.



Relevant Pages

  • Re: cl-quiz
    ... Transpose the 2 and colon. ... #'format doesn't seem to be ... smart enough to talk about puppies or children. ...
    (comp.lang.lisp)
  • Re: cl-quiz
    ... #'format doesn't seem to be ... smart enough to talk about puppies or children. ... "ninety-nine puppies of beer on the wall" ...
    (comp.lang.lisp)