implements java.io.PrintWriter given flush-fn, which will be called
when .flush() is called, with a string built up since the last call to .flush().
if not nil, close-fn will be called with no arguments when .close is called
(with-open[writer(PrintWriter-on(fn[s](printf"Flushing: '%s'%n"s))(fn[](printf"Closing.%n")))](.writewriter"Hello")(.flushwriter)(.writewriter"World!")(println"About to finish..."));; Flushing: 'Hello';; About to finish...;; Flushing: 'World!';; Closing.;; nil