Function pprint-dispatch

Syntax:

pprint-dispatch object &optional table function, found-p

Arguments and Values:

object—an object.

!!! pprint dispatch table designator?? -kmp 16-Oct-91table—a pprint dispatch table, or nil. The default is the value of *print-pprint-dispatch*.

It wasn't obvious if this should be a "function" or "function designator". I asked x3j13 with issue PPRINT-DISPATCH-RETURN-VALUE, but rather than vote on it, they just told me to use my discretion. Which is basically the same as if they had approved the issue. "function designator" it is. -kmp 11-Feb-92function—a function designator.

found-p—a generalized boolean.

Description:

Retrieves the highest priority function in table that is associated with a type specifier that matches object. The function is chosen by finding all of the type specifiers in table that match the object and selecting the highest priority function associated with any of these type specifiers. If there is more than one highest priority function, an arbitrary choice is made. If no type specifiers match the object, a function is returned that prints object with \varref{*print-pretty*} bound to \nil.using print-object.

The secondary value, found-p, is true if a matching type specifier was found in table, or false otherwise.

If table is nil, retrieval is done in the initial value of \varref{*print-pprint-dispatch*}.initial pprint dispatch table.

Examples:

None.

Side Effects:

None.

Affected By:

The state of the table.

Exceptional Situations:

Should signal an error of type type-error if table is neither a pprint dispatch table nor nil.

See Also:

None.

Notes:

(let ((*print-pretty* t))
  (write object :stream s))
≡ (funcall (pprint-dispatch object) s object)