This first example illustrates a format for quoted expressions. For example, ’ANY instead of (QUOTE ANY). A minimal length of two is given, since the list (QUOTE) should not be printed as ’. The argument to quote is formatted by a separate call on dispatch.
The elements of a vector should be enclosed within square brackets. Since the length of vectors will vary a list of format symbols is supplied to be used repetitively for each element. This list will be matched against a corresponding list of components, (vector2list item). Each element is formatted by a recursive call on dispatch. Elements are separated by inconsistent blanks, therefore if the entire vector does not fit on a single line the ouput will be something like
Given the expression (setq n-one v-one n-two v-two)
is preferred over
The following can be used to obtain the preferred output.
The first form of ouput is obtained by using inconsistent blanks after the names (n-one and n-two) and consistent blanks after the values (v-one and v-two). When this expression will not fit on a single line the consistent blanks will correspond to line breaks and unless a value is too large to fit on an output line, the inconsistent blanks will correspond to spaces. The zero offset associated with the consistent blanks corresponds to the block of names and values. This is why the names line up within a column. If the inner logical brackets were omitted the output would look something like
assuming that the expression would not fit on a single line. Notice that the format for a single pair (name and value) is used repetitively.
A format function may contain more than one call on template. The two functions below are equivalent.