Skip to content

Instantly share code, notes, and snippets.

@tuturto
Created December 11, 2015 06:49
Show Gist options
  • Save tuturto/15f54bec97d150f4c3dc to your computer and use it in GitHub Desktop.
Save tuturto/15f54bec97d150f4c3dc to your computer and use it in GitHub Desktop.
(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