The followings are special variables controlling printer's behaviors.
- *print-case*
- if this is :downcase,
all symbols are printed in lowercase
althought symbols are represented in uppercase
internally unless they are escaped.
- *print-circle*
- print objects preserving recursive refernce
- *print-object*
- print the details of all objects
- *print-structure*
- print objects using #s format.
- *print-level*
- printable depth of a sequence
- *print-length*
- printable length of a sequence
- *print-escape*
- currently not used
- *print-pretty*
- currently not used
- *print-base*
- number base in printing; defaulted to decimal ten
In order to print objects containing recursive references
so that they can be read back again,
print the objects with both *print-circle* and
*print-structure* set to T.
Although most of the user defined objects can be printed in re-readable forms,
classes, compiled-codes and packages cannot be dumped in that way,
because classes and compiled-code include unrelocatable
executable codes, and the rereading packages
damages the consistency among symbols.
print obj &optional stream [function]
-
-
is prin1 followed by terpri.
prin1 obj &optional stream [function]
-
-
outputs one s-expression in the format that they can be read back again
by read.
The format includes slashes (escapes) and quotation marks.
princ obj &optional stream [function]
-
-
same as print except that princ does not add escape or quote.
Objects printed by princ cannot be read back.
For example, the output of (princ 'abc) is identical with that of
(princ "abc") and the reader cannot distinguish between them.
terpri &optional stream [function]
-
- outputs #newline and
flush stream.
finish-output &optional stream [function]
-
- flushes output stream.
princ-to-string x &optional (l 16) [function]
-
-
prin1-to-string x &optional (l 16) [function]
-
- makes a string-output-stream, writes to it, and get-output-stream-string.
format stream format-string &rest args [function]
-
-
Format only recognizes A(ascii), S(S-expression), D(decimal),
X(hexadicimal), O(octal), C(character), F(floating), E(exponential),
G(general float), V(dynamic number parameter), T(tab)
and %(newline) format specifiers.
(format t "~s ~s ~a ~a ~10,3f~%" "abc" 'a#b "abc" 'a#b 1.2)
---> "abc" |A#B| abc a#b 1.200
pprint obj &optional (stream *standard-output*) (tab 0) (platen 75) [function]
-
- pretty-prints obj.
print-functions file &rest fns [function]
-
-
write the "defun" forms of function definitions of fns out to file.
write-byte integer stream [function]
-
-
write-word integer stream [function]
-
-
write-long integer stream [function]
-
-
write integer as a one-, two- or four-byte binary.
spaces n &optional stream [function]
-
-
outputs spaces n times.
pf func &optional stream *standard-output*) [macro]
-
-
pretty-prints a function. Compiled function cannot be printed.
pp-method class selector &optional (stream *standard-output*) [function]
-
-
pretty-prints the method defined in class by the name of
selector.
tprint obj tab &optional (indent 0) (platen 79) (cpos 0) [function]
-
- print obj in tabular format.
print-size obj [function]
-
-
returns inexact length of obj when it is printed.
k-okada
2013-05-21