Oh, somehow, auto-flushing doesn't work, and that's why I wasn't seeing anything else than nil:
user=> (def w (PrintWriter. (PrintStream. System/out) true)) #'user/w user=> (.print w "bonjour") nil user=> (.flush w) bonjournil So although I asked for auto-flushing, I need to do so manually. Daniel Jomphe wrote: > Since I can't find the way to solve this issue, let's tackle it at a > more fundamental level. > > First, I need to make sure I can print to standard output without > using *out*, so I can later, temporarily bind *out* to something else. > Also, I don't want to print directly to System/out. Later, I'll need > it to be wrapped into something that gives it a proper encoding. > > user=> (import '(java.io PrintWriter PrintStream)) > nil > user=> (.print (PrintWriter. (PrintStream. System/out) true) > "bonjour") > nil > > Do you know how to make this work? --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---