I have following script to show the progress status in Console. But I
am having an issue where print only prints final string (after 100
times loop finished) not those in between thread sleeps but println
prints out all in between. I am pretty new to Clojure ( Lisp for the
matter) and have no idea why. Can someone point out what is the
problem?

(defn progress-string
  [i]
  (for [x (range 50)] (if (<= (/ i 2) x) " " "=")))

(defn show-progress-string
  [t]
  (dotimes [percent 100 ]
    (do
      (Thread/sleep t)
      (println "\r" (str-join "" (seq (progress-string (inc
percent))))))))


Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to