Skip to content

Instantly share code, notes, and snippets.

@cjfrisz
Last active December 22, 2015 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjfrisz/6414524 to your computer and use it in GitHub Desktop.
Save cjfrisz/6414524 to your computer and use it in GitHub Desktop.
Multiple return values in clojure
(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