utilities.print-items

API Reference

utilities.print-items

A protocol for flexible and composable printing.

PRINT-ITEMS

This package contains the utilities.print-items system for
    composable printing. The interface consists of

    * `print-items'                     [generic function]

      Methods extend the printed representation of an object in a
      composable manner.

    * `print-items-mixin'               [class]

      Can be used to make subclasses the print items mechanism when
      passed to `print-object'.

    * `format-print-items'              [function]

      Utility function for formatting print items onto a stream.
  • Generic-Function PRINT-ITEMS (object)
    Return a list of items that should appear in the printed representation of OBJECT. Each method should return a list of items of the form (KEY VALUE [FORMAT [CONSTRAINT*]] where KEY ::= any Lisp object VALUE ::= any Lisp object FORMAT ::= a format string (Default is "~A") CONSTRAINT ::= (:before | :after) KEY When multiple items have `eql' KEYs, items appearing closer to the beginning of the item list take precedence. This mechanism can be used to replace print items produced by superclasses in subclasses.
  • Method PRINT-ITEMS ((object t))
    Default behavior is to not return any print items for OBJECT.
  • Class PRINT-ITEMS-MIXIN
    This mixin class adds printing via `print-items' to classes.
    No slots.
  • Function FORMAT-PRINT-ITEMS (stream items &optional colon? at?)
    Print ITEMS onto STREAM. ITEMS is a list of items of the form (KEY VALUE [FORMAT [CONSTRAINT*]] where KEY ::= any Lisp object VALUE ::= any Lisp object FORMAT ::= a format string (Default is "~A") CONSTRAINT ::= (:before | :after) KEY