Last active
December 22, 2015 04:08
-
-
Save cjfrisz/6414524 to your computer and use it in GitHub Desktop.
Multiple return values in clojure
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 return-multi [a b] (mapv inc [a b])) | |
(defn accept-multi [x] | |
(let [[a b] (return-multi x x)] | |
(+ a b))) | |
(accept-multi 1) | |
;; -> 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment