12.3. Writing

12.3.1. Print vs. Princ

It is not always appropriate to write a data item in a way that can be read by the Lisp reader. For example, the Lisp reader requires that all character strings are surrounded by double quotes to differentiate them from symbols and to deal with white space and special characters. In some cases, the programmer may wish to write a character string in "human-readable" form, with no quotes and escapes on special characters.

The Gamma writer will produce both kinds of output. The print function will always generate output which can be read by the Lisp reader, including escape characters, quotation marks and buffer and instance special forms. The princ function attempts to make the output as readable as possible to a human, but will not necessarily produce output that can be read by the Gamma reader. The name princ is historical, and can simply be thought of as an alternate form of print. Notice that neither princ nor print will automatically place a carriage return at the end of a line. The programmer must explicitly print a "\n" or make a call to terpri.