It is an annoying behavior. I'm not sure it is a bug.
If you wanted Clojure's printf to flush on every newline character it
issues, it would have to somehow scan through the output stream of
characters _after_ they have been formatted to see if there was a newline
character anywhere in there, and
Yeah, this is definitely an annoying bug.
On Thursday, April 10, 2014 8:03:02 PM UTC+8, Kevin Ilchmann Jørgensen
wrote:
>
> nREPL server started on port 53667 on host 127.0.0.1
> REPL-y 0.3.0
> Clojure 1.5.1
> Docs: (doc function-name-here)
> (find-doc "part-of-name-here")
> Sourc
2014-04-10 14:13 GMT+02:00 Di Xu :
> Well, I'm not very familiar with buffer in java. But I think it's always
> safe to call flush if you want to see the output immediately.
>
The problem (in my opinion) is that you do not expect println and printf
to behave differently. I would expect that both
Well, I'm not very familiar with buffer in java. But I think it's always
safe to call flush if you want to see the output immediately.
2014-04-10 19:50 GMT+08:00 Cecil Westerhof :
> 2014-04-10 13:40 GMT+02:00 Di Xu :
>
> there're three buffer mode in unix, line buffered, full buffered and no
>>
nREPL server started on port 53667 on host 127.0.0.1
REPL-y 0.3.0
Clojure 1.5.1
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in
2014-04-10 13:40 GMT+02:00 Di Xu :
> there're three buffer mode in unix, line buffered, full buffered and no
> buffered, if the output is terminal then it's default to line buffered.
> That means it buffer the output until '\n' occurs, you can force output via
> flush.
>
The printf format string
there're three buffer mode in unix, line buffered, full buffered and no
buffered, if the output is terminal then it's default to line buffered.
That means it buffer the output until '\n' occurs, you can force output via
flush.
Thanks,
Di Xu
2014-04-10 19:30 GMT+08:00 Cecil Westerhof :
> 2014-04
2014-04-10 12:52 GMT+02:00 Kevin Ilchmann Jørgensen :
> I believe this is how the terminal behave. You can force an
> (clojure.core/flush)
>
But why does println not behave this way?
I think I stick to println for the moment.
On Thu, Apr 10, 2014 at 12:34 PM, Cecil Westerhof wrote:
>
>> I have
I believe this is how the terminal behave. You can force an
(clojure.core/flush)
/Kevin
On Thu, Apr 10, 2014 at 12:34 PM, Cecil Westerhof wrote:
> I have the following simple program:
> (def time-format (new java.text.SimpleDateFormat "hh:mm:ss"))
>
> (defn now []
> (new java.util