utilities.print-items

API Reference

utilities.print-items

A protocol for flexible and composable printing.

UTILITIES.PRINT-ITEMS

Utilities 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 ::= `nil' or 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 by subclasses to replace print items produced by superclasses. When FORMAT is `nil' the whole item is ignored. This mechanism can be used by subclasses to disable print items produced by superclasses.
  • Method PRINT-ITEMS ((object t))
  • 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 ::= `nil' or a format string (Default is "~A") CONSTRAINT ::= (:before | :after) KEY