On Monday 15 December 2008 15:22, Stephen C. Gilardi wrote: > On Dec 15, 2008, at 6:08 PM, Randall R Schulz wrote: > > user=> (class *err*) > > java.io.PrintWriter > > PrintWriter is (as far as I can determine) the more modern of the two > classes that are accepted as an argument to > "Throwable.printStackTrace" which is used frequently in Clojure's > implementation. *err* also has the "autoflush" option turned on which > is not appropriate for *out*. > > I've thought of suggesting PrintWriter for *out* in the past, but I > saw that for Clojure's implementation, only OutputStreamWriter is > required. If you have a need for a PrintWriter you can bind *out* to > one, or better yet, use another dynamic variable to hold a > PrintWriter with *out* as its sink. > > Would that be sufficient to accomplish your goal?
Well, if *out* continues to be a vanilla (non-Print-) Writer, then it will have to be, I suppose. I consider it pretty fragile to work with an altered root binding for *out*, so I doubt I'll go that route. On the other hand, having multiple paths that ultimately converge on System/out leads to the potential for out-of-order appearance of data directed through those disparate paths when they are liberal in their flushing policy (which in this context means they do rather little of it). So from my perspective there's no ideal solution under the current circumstances. I really don't know why *out* (its initial root binding) should _not_ be a PrintWriter, especially when it is ultimately directed at System/out, which is itself a PrintStream. And why is *err* a PrintWriter when *out* is not? Consider, too, that PrintWriter has format(...) / printf(...) methods not available on any non-Print Writer class. > --Steve Randall Schulz --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---