Replies: 1 comment
-
I don't think so. IIUC, Here are some examples for (do
(def arr @[2 0 1])
(sort arr >)
arr)
# =>
@[2 1 0]
(do
(def arr @[[:fun 0] [:swim 2] [:play -1]])
(sort arr (fn [[_ x] [_ y]]
(< x y)))
arr)
# =>
'@[(:play -1) (:fun 0) (:swim 2)]
Possibly of interest might be this document. |
Beta Was this translation helpful? Give feedback.
-
cmp
and functions like it that return either-1
,0
, or1
when comparing two items -- are they meant to be used withsort
/sorted
? If not, is there a standard lib function or functions with which they're intended to be used?Beta Was this translation helpful? Give feedback.
All reactions