Created
December 11, 2015 06:49
-
-
Save tuturto/15f54bec97d150f4c3dc 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
(defn foo [] | |
(if check | |
return-value) | |
(extra-thingy-1 param1 param2) | |
(extra-thingy-2 param1 param2)) | |
;; extra-thingies will always be evaluated, regardless of check | |
;; return value of the function will be extra-thingy-2 | |
(defn foo [] | |
(if check | |
return-value | |
(do (extra-thingy-1 param1 param2) | |
(extra-thingy-2 param1 param2))) | |
;; extra-thingies will only be evaluated when check fails | |
;; return value of function will be either return-value or extra-thingy-2, depending on the check | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment