Skip to content

Instantly share code, notes, and snippets.

@fronx
Created July 26, 2011 07:54
Show Gist options
  • Select an option

  • Save fronx/1106227 to your computer and use it in GitHub Desktop.

Select an option

Save fronx/1106227 to your computer and use it in GitHub Desktop.
(defn $
"Amount of money in USD"
([x] ($ x 0))
([x y] (+ x (/ y 100))))
(defn €
"Amount of money in EUR"
([x] (€ x 0))
([x y] ($ (€-to-$ x) y)))
(defn €-to-$
"Returns the USD equivalent of an amount in EUR"
([x] ($ x 45)))
(€ 4 30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment