Patching swank might be appropriate but doesn't address several
incorrect assumptions made by c.c.sql:
1) *err* and *out* promise to implement java.io.Writer in the
documentation not java.io.PrintWriter. Calling .println on *out* or
*err* is not appropriate.
I started in the same mental place as you. See
http://groups.google.com/group/clojure-dev/browse_thread/thread/369734ff42cbb06a/cc9e30534c78b6b3?lnk=gst&q=sql+println#cc9e30534c78b6b3
Steven asserted that this was a Clojure doc bug, not a sql bug. Given
that Steven added *err* to Clojure, I trust his judgment about what
the code is supposed to do :)
I personally still feel that switching those ".println"s to "printlns"
would be neater, but it's really no big deal.
It's also cheap to wrap a Writer in a PrintWriter, as I did with swank-
clojure.
2) c.c.sql shouldn't assume that we want anything printed at all?!
Just throw the SQLException.
Printing to *err* is acceptable IMO. This is the common "should my
library write log messages, and if so how?" problem. I'd rather have
it print to *err* than use Java Logging.
3) c.c.sql's use of throwf unnecessarily wraps the SQLException into
java.lang.Exception. Doing so isn't useful, especially if you want
handle an SQLException earlier than an unknown exception.
That sounds like a reasonable complaint. Perhaps mail Steven to
discuss, or create an Assembla issue?
--
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
Note that posts from new members are moderated - please be patient with your
first post.
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