5 ms·
We're talking about I/O here, so we're already outside the domain of functional programming: It's necessary to specify where the output is supposed to go, and t
by dreamcompiler 4y ago
We're talking about I/O here, so we're already outside the domain of functional programming: It's necessary to specify where the output is supposed to go, and that's what format's first argument is for.
If you want purely functional string creation, #'format can handle that by passing it nil as its "where" argument.
In both cases #'format does the same thing; the only difference is where the output goes. If #'format knows it's operating non-functionally it can avoid consing up a string and send its output directly to the destination. So it's not necessarily the case that (format t s) creates a string at all.