We're updating the issue view to help you get more done. 

UUID compares equal to other values

Description

1 2 3 4 5 6 7 8 9 10 11 12 $ clj -m cljs.main -re node -r ClojureScript 1.10.520 cljs.user=> (compare "a" (random-uuid)) Execution error (Error) at (<cljs repl>:1). Cannot compare a to f151d12d-7bd5-4409-9352-5900ee07baf7 cljs.user=> (compare (random-uuid) "a") 0 cljs.user=> (compare (random-uuid) 'a) 0 cljs.user=> (compare (random-uuid) nil) 1

For reference: Clojure:

1 2 3 4 5 6 7 8 9 10 11 12 $ clj Clojure 1.10.1 user=> (import '(java.util UUID)) java.util.UUID user=> (compare (UUID/randomUUID) "a") Execution error (ClassCastException) at java.util.UUID/compareTo (UUID.java:70). java.lang.String cannot be cast to java.util.UUID user=> (compare (UUID/randomUUID) 'a) Execution error (ClassCastException) at java.util.UUID/compareTo (UUID.java:70). clojure.lang.Symbol cannot be cast to java.util.UUID user=> (compare (UUID/randomUUID) nil) 1

See

Environment

None

Status

Assignee

David Nolen

Reporter

Mike Fikes

Labels

None

Approval

None

Patch

None

Priority

Major