Skip to content

Instantly share code, notes, and snippets.

@spoon16
Created December 6, 2011 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spoon16/1436973 to your computer and use it in GitHub Desktop.
Save spoon16/1436973 to your computer and use it in GitHub Desktop.
Protocol that normalizes different country representations
(defprotocol PCountryId
(country-id [c]))
(extend-protocol PCountryId
String (country-id [c] (country-id (NFCountry/findInstance c)))
clojure.lang.Keyword (country-id [c] (country-id (name c)))
NFCountry (country-id [c] (.getId c)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment