;; iteratively prints the value of x (after a pause of 100ms)
(doseq [x (range 20)]
(Thread/sleep 100)
(pr x)
(flush))
;; without a `flush` at each iteration,
;; we'll get all the output stream at once flushed and printed only at the end
;; of `doseq` evaluation.
(doseq [x (range 20)]
(Thread/sleep 100)
(pr x))