Created
August 12, 2011 01:33
-
-
Save swannodette/1141252 to your computer and use it in GitHub Desktop.
patjava.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns match.java | |
(:refer-clojure :exclude [compile]) | |
(:use [match.core])) | |
(extend-type java.util.Date | |
IPLookup | |
(p-val-at [this key] | |
(case key | |
:year (.getYear this) | |
:month (.getMonth this) | |
:date (.getDate this) | |
:hours (.getHours this) | |
:minutes (.getMinutes this) | |
nil))) | |
(comment | |
(let [x (java.util.Date. 2010 10 1 12 30)] | |
(match [x] | |
[{2009 :year month :month date :date}] [:a0 month date] | |
[{2010 :year month :month date :date}] [:a1 month date])) | |
;; [:a1 10 1] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment