Lazy-spy: Clojure logging/spy for lazy sequences

Clojure.contrib’s log/spy macro does not realize the contents of lazy sequences by default when logging, as they might be infinitely long. If you’re sure that your lazy sequence is finite, you can use this lazy-spy macro to force it to be realized when it’s logged, so that you can inspect the contents.

Posted in Tech | Tagged , | Comments Off on Lazy-spy: Clojure logging/spy for lazy sequences

XML DTD Validation in Clojure: Turning It Off, Parsing Malformed XML

I wanted to parse some externally-generated and malformed HTML, so naturally I went to the short and sweet clojure.xml/parse function. I got a nasty error: error: Server returned HTTP response code: 503 for URL: It seems that the W3C blocked access to the DTDs two years ago, but Java still tries to load […]