Skip to content

Instantly share code, notes, and snippets.

@mrzor
Last active August 23, 2016 12:41
Show Gist options
  • Save mrzor/830100559d9b330c0c8bce9fa92210ce to your computer and use it in GitHub Desktop.
Save mrzor/830100559d9b330c0c8bce9fa92210ce to your computer and use it in GitHub Desktop.
UUID heresy
(defn ^StringBuilder stringbuilder-append-UUID [^StringBuilder sb ^UUID uuid]
(doto sb
(.append "#UUID\"")
(.append (.getLeastSignificantBits uuid))
(.append "\"")))
(defmethod print-method UUID [^UUID v ^java.io.Writer w]
(.append
w
(stringbuilder-append-UUID (StringBuilder. 60) v)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment