User Tools

A PCRE internal error occured. This might be caused by a faulty plugin


This shows you the differences between two versions of the page.

Link to this comparison view

cl:macros:print-unreadable-object [2019/09/14 05:00]
cl:macros:print-unreadable-object [2020/08/08 13:00] (current)
Line 1: Line 1:
 +====== Macro PRINT-UNREADABLE-OBJECT ======
 +  * //​print-unreadable-object//​ (//object// //stream// ''&​key''​ //type// //​identity//​) //​form//''​*''​ → **[[CL:​Constant Variables:​nil]]**
 +====Arguments and Values====
 +  * //object// - an //​[[CL:​Glossary:​object]]//;​ evaluated.
 +  * //stream// - a //​[[CL:​Glossary:​stream designator]]//;​ evaluated.
 +  * //type// - a //​[[CL:​Glossary:​generalized boolean]]//;​ evaluated.
 +  * //​identity//​ - a //​[[CL:​Glossary:​generalized boolean]]//;​ evaluated.
 +  * //forms// - an //​[[CL:​Glossary:​implicit progn]]//.
 +Outputs a printed representation of //object// on //stream//, beginning with ''#<''​ and ending with ''>''​. Everything output to //stream// by the body //forms// is enclosed in the the angle brackets. If //type// is //​[[CL:​Glossary:​true]]//,​ the output from //forms// is preceded by a brief description of the //​object//'​s //​[[CL:​Glossary:​type]]//​ and a space character. If //​identity//​ is //​[[CL:​Glossary:​true]]//,​ the output from //forms// is followed by a space character and a representation of the //​object//'​s identity, typically a storage address.
 +If either //type// or //​identity//​ is not supplied, its value is //​[[CL:​Glossary:​false]]//​. It is valid to omit the body //forms//. If //type// and //​identity//​ are both true and there are no body //forms//, only one space character separates the type and the identity.
 +Note that in this example, the precise form of the output is //​[[CL:​Glossary:​implementation-dependent]]//​.
 +<​blockquote> ​
 +([[CL:​Macros:​defmethod]] print-object ((obj airplane) stream) ​
 +  (print-unreadable-object (obj stream :type [[CL:​Constant Variables:​t]] :identity [[CL:​Constant Variables:​t]]) ​
 +    ([[CL:​Functions:​princ]] (tail-number obj) stream)))
 +<​r>#<​STANDARD-METHOD PRINT-OBJECT (AIRPLANE [[CL:​Constant Variables:​T]]) {10024E2943}></​r>​
 +([[CL:​Functions:​prin1-to-string]] my-airplane) ​
 +<​r>"#<​Airplane NW0773 36000123135>"​ </r>
 +<​r>//​or//​ "#<​FAA:​AIRPLANE NW0773 17>"​ </r>
 +====Affected By====
 +====Exceptional Situations====
 +If **[[CL:​Variables:​star-print-readably-star|*print-readably*]]** is //​[[CL:​Glossary:​true]]//,​ **print-unreadable-object** signals an error of type **[[CL:​Types:​print-not-readable]]** without printing anything.
 +====See Also====