XLISP pprint

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference

# pprint

Type: | - | function (subr)
Source: | - | xlpp.c

## Syntax

(pprint expr [dest])
  expr - an expression to be pretty printed
  dest - an optional destination, must be a file pointer or stream, default is *standard-output*
  returns - always returns NIL

## Description

The 'pprint' function produces a pretty looking version of the 'expr' and prints it to the specified 'destination'. If 'expr' is an atom like a string, a symbol, a number, etc., 'pprint' will print it like print. If 'expr' is a list, it will perform indenting, as necessary. NIL is always returned as the result of 'pprint'. The 'destination' may be a file pointer or a stream. If there is no 'destination' or it is NIL , *standard-output* is the default.

## Examples

    (pprint 'a)      ; prints  A       returns NIL
    (pprint "abcd")  ; prints  "abcd"  returns NIL

    (pprint '(a-very-long-name (first list) (second list)))

                     ; prints (A-VERY-LONG-NAME (FIRST LIST)
                     ;                          (SECOND LIST))
                     ; returns NIL

Common Lisp: Common Lisp specifies that 'pprint' with a 'destination' of NIL will go to *standard-output*. XLISP does not send the output to *standard-output* with a 'destination' of NIL. Common Lisp also specifies that a 'destination' of T will be sent to *terminal-io*, which is not defined in XLISP by default. XLISP does not allow T as a valid argument for 'destination'.

See the pprint function in the XLISP 2.0 manual.

Back to Top

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference