Created
September 30, 2010 20:31
-
-
Save duncanmak/605263 to your computer and use it in GitHub Desktop.
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
(defmulti distance #(vector (class %1) (class %2))) | |
(defmethod distance [IPersistentVector IPersistentVector] | |
[p q] | |
(let [[x1 y1] p, [x2 y2] q] | |
(.distance (Point. x1 y1) (Point. x2 y2)))) | |
(defmethod distance [Point Point] | |
[p q] (.distance p q)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment