6 ms·
FORMAT does not send a string to a file. It executes a program in a domain specific language which creates output to a stream. This does a bunch of operations
by lispm 4y ago
FORMAT does not send a string to a file.
It executes a program in a domain specific language which creates output to a stream.
This does a bunch of operations. The print functions are being executed on an output stream. If the ARG is NIL, then FORMAT creates a string output stream and later returns the generated string.
(format nil "~a" 3)
is just short for:
(with-output-to-string (stream)
(format stream "~a" 3))
~a is then an operation which writes the argument 3 to the output stream.