I have the following code in clojure:
(do
(println "starting....")
(sig! a 0)
(sig! b 0)
(future
(Thread/sleep 4000)
(println "switch 1")
(sig! a 1)
(sig! b 0)
(Thread/sleep 4000)
(println "switch 2")
(sig! a 0)
(sig! b 1)
(Thread/sleep 4000)
(println "switch 3")
(sig! a 1)
(sig! b 1)) nil))
I have observers who listen to atoms a, b, s and c1 and print out some lines when they change. Use (print (str uid ":" @o "\n")or version of println. Clojure documents say print, and printlnare expected to behave in the same way, except a new line in println, but I do not see it. When the observer uses println, I immediately see the lines. When the observer uses print. I only see the exit when the next one is called println. Below, I have output printlnvs with print. With printI see only the values to the last println.
starting....
switch 1
a:1
s:1
switch 2
a:0
b:1
s:0
s:1
switch 3
Now with println
starting....
switch 1
a:1
s:1
switch 2
a:0
b:1
s:0
s:1
switch 3
a:1
s:0
c1:1
, , . clojure 1.5. , print , println .