Created
January 14, 2014 05:13
-
-
Save chespinoza/8413427 to your computer and use it in GitHub Desktop.
Guards
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
(defn make-greetings | |
[hello] | |
{:pre [(string? hello) (< (count hello) 10)] ; pre-validation guards | |
:post [(string? %)]} ; result validation | |
(fn [name] | |
(str hello " " name "!"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment