## 5.19 Unit: format

[procedure] (format DESTINATION FORMAT-STRING . ARGUMENTS)
  An almost complete implementation of Common LISP format description according to the CL reference book Common LISP from Guy L. Steele, Digital Press. This code was originally part of SLIB. The author is Dirk Lutzebaeck.

  Returns `#t`, `#f` or a string; has side effect of printing according to `FORMAT-STRING`. If `DESTINATION` is `#t`, the output is to the current output port and `#t` is returned. If `DESTINATION` is `#f`, a formatted string is returned as the result of the call. If `DESTINATION` is a string, `DESTINATION` is regarded as the format string; `FORMAT-STRING` is then the first argument and the output is returned as a string. If `DESTINATION` is a number, the output is to the value of `(current-error-port)`. Otherwise `DESTINATION` must be an output port and `#t` is returned.

  `FORMAT-STRING` must be a string. In case of a formatting error format returns `#f` and prints a message on the value of `(current-error-port)`. Characters are output as if the string were output by the `display` function with the exception of those prefixed by a tilde (~). For a detailed description of the `FORMAT-STRING` syntax please consult a Common LISP format reference manual. A list of all supported, non-supported and extended directives can be found in `format.txt`.

  This unit uses definitions from the `extras` unit.

  `format` implements SRFI-28 24

24 http//srfi.schemers.org/srfi-28/srfi-28.html