10.08.2010

Clojure Dates with Java Interop

I really just want to test how an embedded gist looks in blogger. I thought I would do it with a simple function I wrote to test if a date object was between two other date objects in clojure. I found how to do it in Java on stackoverflow, so I took advantage of clojure's java interop, and this is what we get:

(defn in-range [start end d]
(not (or (.before d start)
(.after d end))))
view raw gistfile1.clj hosted with ❤ by GitHub

No comments:

Post a Comment