2013/3/12 <edw...@kenworthy.info>

> So I do not understand why calling
>
>   (defn evolve []
>     (Thread/sleep 1000)
>     (print ".")
>     (recur))
>
> Never results in anything being printed until I press Ctrl-C at which
> point a bunch of . are printed.
>
> However if I remove (Thread/sleep 1000) then it works as I would expect.
>
> I thought (Thread/sleep 1000) would basically wait for a second (allowing
> other threads to run) and then continue but it *appears* to work as I would
> expect but it blocks output (both to the console and, I think, to the
> seesaw frame/canvas created separately).
>

The output is buffered, try by adding a call to (flush) after each (print
".")

HTH,

-- 
Laurent

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to