Permalink
Browse files

Clarify doc strings of sort and sort-by: they will modify Java array …

…arguments

Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
  • Loading branch information...
1 parent fb653b7 commit d8be6135cabc981f7043efe5fd7a386a3faf3bd2 @jafingerhut jafingerhut committed with stuarthalloway Mar 26, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/clj/clojure/core.clj
@@ -2690,8 +2690,9 @@
(defn sort
"Returns a sorted sequence of the items in coll. If no comparator is
- supplied, uses compare. comparator must
- implement java.util.Comparator."
+ supplied, uses compare. comparator must implement
+ java.util.Comparator. If coll is a Java array, it will be modified.
+ To avoid this, sort a copy of the array."
{:added "1.0"
:static true}
([coll]
@@ -2706,8 +2707,9 @@
(defn sort-by
"Returns a sorted sequence of the items in coll, where the sort
order is determined by comparing (keyfn item). If no comparator is
- supplied, uses compare. comparator must
- implement java.util.Comparator."
+ supplied, uses compare. comparator must implement
+ java.util.Comparator. If coll is a Java array, it will be modified.
+ To avoid this, sort a copy of the array."
{:added "1.0"
:static true}
([keyfn coll]

0 comments on commit d8be613

Please sign in to comment.