|
![]() |
Accepts both
strings and numbers |
Prints
control characters |
Prints new
line and trailing space |
Quotation
marks for strings |
Returns
(when printing strings) |
|
prin1 | yes | verbatim | no | "xxxxxx" | "xxxxxx" |
princ | yes | interpreted | no | xxxxxx | "xxxxxx" |
yes | verbatim | yes | "xxxxxx" | "xxxxxx" | |
prompt | strings only | interpreted | no | xxxxxx | nil |
(prin1 'a) prints A and returns A
(prin1 "hello") prints "hello" and returns "hello"
After (setq a 15.9 b "good bye")
(prin1 a) prints 15.9 and returns 15.9
(prin1 b) prints "good bye" and returns "good bye"
(prin1 b fw) prints "good bye" to the file buffer identified
by variable fw (assuming it has already been opened for writing) and returns
"good bye"
(prin1 (chr 10)) prints "\n" verbatim and returns "\n"
(prin1) returns nothing. Can be used as the last function in
a program to cancel the display of "nil" or other extraneous output.
The following control characters will function as described when made
part of a string (included in quotation marks):
\n carriage return and line feed (new line)
\r carriage return only (cursor stays on same line)
\t tab every 8 columns (9th, 17th, 25th, etc.)
\\ single backslash (useful for path names - or, a single forward
slashes can be used in path names)
\e escape character (useful for sending escape codes to a printer,
etc.)
\xxx character whose octal (base 8) code is xxx
(prompt "Dog yummies") displays Dog yummies on the
screen
(terpri) prints carriage return and line feed, returns nil (not
used for file output)