Add a (finish-output)
after the princ
.
Printing to screen while in loop
-
05-08-2022 - |
Question
I have this:
(loop for i below x
do (update-world)
if (zerop (mod i 1000))
do (princ #\.))
It is working, except that all the princ
invokations arrive at once, at the end. The idea here is that they are a progress indicator, printing a period to the screen every 1000 iterations. This is from the Land of Lisp book, and I'm wondering if expecting printing in the middle of a loop is not a portable expectation?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow