printf does not always generate output

59 views
Skip to first unread message

Cecil Westerhof

unread,
Feb 27, 2015, 2:13:35 PM2/27/15
to clo...@googlegroups.com
My core.clj ends with:
    (println (format "Started: %s (println)" (java.util.Date.)))
    (printf "Started: %s (printf)\n" (java.util.Date.))

I do not see the output from the printf when I run 'lein repl'.
The funny thing is that when I switch the two statements, both are shown.
Also when I do 'lein run' both are shown.

What could be happening here?

For the moment I changed all my printf to println with format, but it is a little annoying.


--
Cecil Westerhof

Steve Miner

unread,
Feb 27, 2015, 2:32:15 PM2/27/15
to clo...@googlegroups.com
Try adding (flush) at the end.

Andy Fingerhut

unread,
Feb 27, 2015, 2:36:21 PM2/27/15
to clo...@googlegroups.com
Not every function and macro is documented completely or accurately on ClojureDocs.org, but I would recommend checking it out when you run across something that looks amiss, and see if the examples mention what you are seeing.  In this case, it does:


Andy


--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cecil Westerhof

unread,
Feb 27, 2015, 4:37:38 PM2/27/15
to clo...@googlegroups.com
2015-02-27 20:36 GMT+01:00 Andy Fingerhut <andy.fi...@gmail.com>:
Not every function and macro is documented completely or accurately on ClojureDocs.org, but I would recommend checking it out when you run across something that looks amiss, and see if the examples mention what you are seeing.  In this case, it does:

 
​That is certainly a place I should look more often. :-) A wealth of information.


On Fri, Feb 27, 2015 at 11:12 AM, Cecil Westerhof <cldwes...@gmail.com> wrote:
My core.clj ends with:
    (println (format "Started: %s (println)" (java.util.Date.)))
    (printf "Started: %s (printf)\n" (java.util.Date.))

I do not see the output from the printf when I run 'lein repl'.
The funny thing is that when I switch the two statements, both are shown.
Also when I do 'lein run' both are shown.

What could be happening here?

For the moment I changed all my printf to println with format, but it is a little annoying.


--
Cecil Westerhof

Sam Raker

unread,
Feb 27, 2015, 4:47:44 PM2/27/15
to clo...@googlegroups.com
I have https://jafingerhut.github.io/cheatsheet/grimoire/cheatsheet-tiptip-cdocs-summary.html bookmarked and also like basically always open in a tab forever, fwiw. 

Cecil Westerhof

unread,
Feb 27, 2015, 5:08:27 PM2/27/15
to clo...@googlegroups.com
2015-02-27 22:47 GMT+01:00 Sam Raker <sam....@gmail.com>:
I have https://jafingerhut.github.io/cheatsheet/grimoire/cheatsheet-tiptip-cdocs-summary.html bookmarked and also like basically always open in a tab forever, fwiw. 

​Also good information.
 
--
Cecil Westerhof
Reply all
Reply to author
Forward
0 new messages