Next: , Up: Common Lisp Formatting   [Contents][Index]

6.4.1 format Function

Function: format destination control-string &rest format-args

Takes two required arguments:

  1. destination for output
    • t’ : the ‘*standard-output*’ stream;
    • nil’ : format generates a string and returns it;
    • a stream : output written to this stream;
    • string with fill-pointer : ougtput is added to the end of the string and the fill pointer is adjusted;
  2. control-string that contains literal text and embedded directives;
  3. additional optional format-args provide the values used by the directives in the control string that interpolate values into the output.

format returns ‘nil’ except when destination is ‘nil’, in which case it returns the newly-generated string.