[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

Re: With format, how to print a variable number of spaces

William James

10/26/2015 8:55:00 PM

> > (loop for i below 4 do
> (format t "I'm so~V{ ~A~:*~} happy!~%" i '("very")))
> I'm so happy!
> I'm so very happy!
> I'm so very very happy!
> I'm so very very very happy!

MatzLisp (Ruby):

4.times{|i| print "You're so ", "very " * i, "vain!\n"}

You're so vain!
You're so very vain!
You're so very very vain!
You're so very very very vain!

--
In the latter case, arrests are made, not so much for what has been done, as
for what probably would be done. The latter is more for the preventive, and
less for the vindictive, than the former. --- A. Lincoln, Letter to Erastus
Corning, June 12, 1863