Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

III. Lisp is Hacking > 11. Printing Text with the format Function

Chapter 11. Printing Text with the format Function

Even in this modern era of programming, it’s extremely important to be able to manipulate text, and Common Lisp has some of the fanciest text-printing functions available. Whether you need to manipulate XML, HTML, Linux configuration files, or any other data in a textual format, Lisp will make your work easy.

The most important advanced text printing function in Common Lisp is the format function, which is the subject of this chapter.

Anatomy of the format Function

Here is an example of the format function in use:

> (format t "Add onion rings for only ˜$ dollars more!" 1.5)
Add onion rings for only 1.50 dollars more!
NIL

Let’s take a look at what each part of this function means.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint