문제

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?

도움이 되었습니까?

해결책

Add a (finish-output) after the princ.

http://clhs.lisp.se/Body/f_finish.htm

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top