type | since v0.0-1424 | Edit |
(UUID. uuid __hash)
A type representing a universally unique identifier (UUID).
Use uuid
or #uuid literal
to create one.
(deftype UUID [uuid ^:mutable __hash]
IUUID
Object
(toString [_] uuid)
(equiv [this other]
(-equiv this other))
IEquiv
(-equiv [_ other]
(and (implements? IUUID other) (identical? uuid (.-uuid other))))
IPrintWithWriter
(-pr-writer [_ writer _]
(-write writer (str "#uuid \"" uuid "\"")))
IHash
(-hash [this]
(when (nil? __hash)
(set! __hash (hash uuid)))
__hash)
IComparable
(-compare [this other]
(if (instance? UUID other)
(garray/defaultCompare uuid (.-uuid other))
(throw (js/Error. (str "Cannot compare " this " to " other))))))