Skip to content

Instantly share code, notes, and snippets.

@alexanderjamesking
Created April 28, 2018 14:44
Show Gist options
  • Save alexanderjamesking/030f583368bf72d9e4780f48c417d48a to your computer and use it in GitHub Desktop.
Save alexanderjamesking/030f583368bf72d9e4780f48c417d48a to your computer and use it in GitHub Desktop.
(def beatle->email
{:john "[email protected]"
:paul "[email protected]"
:george "[email protected]"
:ringo "[email protected]"})
(defn lookup-email [beatle-id]
(get beatle->email beatle-id))
(defn send-message [email message]
(println (str "Sending " message " to " email))
nil)
(defn email-beatle [beatle-id message]
(when-let [email (lookup-email beatle-id)]
(send-message email message)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment