Created
April 28, 2018 14:44
-
-
Save alexanderjamesking/030f583368bf72d9e4780f48c417d48a 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
(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