Capitalizing words; the flexible format directive

From an exercise in the second chapter of PAIP. This takes a list of words and prints them in a list, with the first one capitalized.

(defun print-words (wordlist)
    (format t "~&~@(~A~) " (car wordlist))  
    (format t "~{ ~A~}." (cdr wordlist)))

The list of format directives are large and varied indeed!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s