Created
December 1, 2011 18:37
-
-
Save gorsuch/1418850 to your computer and use it in GitHub Desktop.
clojure uuid
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 uuid [] (str (java.util.UUID/randomUUID))) |
Also, just noticed this library: http://danlentz.github.io/clj-uuid/ Hope it helps :)
👍
good
👍
👍
Is it weird/bad that I like this form instead?
(def uuid #(str (java.util.UUID/randomUUID)))
@kenfehling It's not particularly weird or bad, but one small downside is that the function will lack the :arglists
metadata the way you've written it (try running (:arglists (meta #'uuid))
), which some development tooling might rely on to show you how to call the function.
thanks!
¡Hartas gracias!
thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍 me too