Tutorial by Examples

The first two arguments to format are an output stream and a control string. Basic use does not require additional arguments. Passing t as the stream writes to *standard-output*. > (format t "Basic Message") Basic Message nil That expression will write Basic Message to standard ou...
One can iterate over a list using ~{ and ~} directives. CL-USER> (format t "~{~a, ~}~%" '(1 2 3 4 5)) 1, 2, 3, 4, 5, ~^ can be used to escape if there are no more elements left. CL-USER> (format t "~{~a~^, ~}~%" '(1 2 3 4 5)) 1, 2, 3, 4, 5 A numeric argument can ...
Conditional expressions can be done with ~[ and ~]. The clauses of the expression are separated using ~;. By default, ~[ takes an integer from the argument list, and picks the corresponding clause. The clauses start at zero. (format t "~@{~[First clause~;Second clause~;Third clause~;Fourth cl...

Page 1 of 1