Update sort documentation.

This commit is contained in:
Calvin Rose 2021-02-04 20:11:24 -06:00
parent b168b0758a
commit d374e90033
1 changed files with 4 additions and 4 deletions

View File

@ -783,8 +783,8 @@
(sort-help a 0 (- (length a) 1) (or by <)))
(defn sort-by
`Returns a new sorted array that compares elements by invoking
a function on each element and comparing the result with <.`
``Returns `ind` sorted by calling
a function `f` on each element and comparing the result with <.``
[f ind]
(sort ind (fn [x y] (< (f x) (f y)))))
@ -794,8 +794,8 @@
(sort (array/slice ind) by))
(defn sorted-by
`Returns a new sorted array that compares elements by invoking
a function on each element and comparing the result with <.`
``Returns a new sorted array that compares elements by invoking
a function `f` on each element and comparing the result with <.``
[f ind]
(sorted ind (fn [x y] (< (f x) (f y)))))