The Practical Common Lisp page 25, explains the WITH-STANDARD-IO-SYNTAX as follows. “It ensures that certain variables that affect the behavior of PRINT are set to their standard values”.
The usage is as follows.
(with-open-file (...)
(with-standard-io-syntax
(print ...
Should (print) be used in this macro? If not, what would happen?
Various dynamic variables affect the output produced by
print.with-standard-io-syntaxensures those variables are set to the default values.For example:
Prints:
It’s particularly important if you’re printing things with the intention of being able to
readthem later (like withprin1).