22.6. Printing Other Arrays [sec_22-1-3-8]

22.6.1. Printing Pathnames

When *PRINT-READABLY* is true, other arrays are written as follows: if the ARRAY-ELEMENT-TYPE is T, the syntax #rankA contents is used. Otherwise, the syntax #A(element-type dimensions contents) is used.

As explicitly permitted by this section, specialized BIT and CHARACTER ARRAYs are printed with the innermost lists generated by the printing algorithm being instead printed using BIT-VECTOR and STRING syntax, respectively.

Variable CUSTOM:*PRINT-EMPTY-ARRAYS-ANSI*. Empty ARRAYs, i.e., arrays with no elements and zero ARRAY-TOTAL-SIZE (because one of its dimensions is zero) are printed with the readable syntax #A(element-type dimensions contents), unless the variable CUSTOM:*PRINT-EMPTY-ARRAYS-ANSI* is non-NIL, in which case the arrays are printed using the [ANSI CL standard]-prescribed syntax #rankA contents which often loses the dimension information.

22.6.1. Printing Pathnames [sec_22-1-3-11]

Pathnames are printed as follows: If *PRINT-ESCAPE* is NIL, only the namestring is printed; otherwise it is printed with the #P syntax, as per the [ANSI CL standard] issue PRINT-READABLY-BEHAVIOR:CLARIFY. But, if *PRINT-READABLY* is true, we are in trouble as #P is ambiguous (which is verboten when *PRINT-READABLY* is true), while being mandated by the [ANSI CL standard]. Therefore, in this case, CLISP's behavior is determined by the value of CUSTOM:*PRINT-PATHNAMES-ANSI*: when it is NIL, we print pathnames like this: #-CLISP #P"..." #+CLISP #S(PATHNAME ...). Otherwise, when the variable CUSTOM:*PRINT-PATHNAMES-ANSI* is non-NIL, the #P notation is used as per [sec_1-5-1-4-1] Resolution of Apparent Conflicts in Exceptional Situations.

Note

The #S notation for PATHNAMEs is used extensively in the [Common Lisp HyperSpec] (see examples for PATHNAME, PATHNAMEP, PARSE-NAMESTRING et al), but was decided against, see PATHNAME-PRINT-READ:SHARPSIGN-P.

Warning

When both *PRINT-READABLY* and CUSTOM:*PRINT-PATHNAMES-ANSI* are non-NIL and the namestring will be parsed to a dissimilar object (with the current value of CUSTOM:*PARSE-NAMESTRING-DOT-FILE*), an ERROR of type PRINT-NOT-READABLE is SIGNALed.


These notes document CLISP version 2.49Last modified: 2010-07-07