The point of issorted is to check whether calling sort is useful or necessary. Think of it as asking “If I call sort with this value for its lt parameter, will it return the array unchanged?” You shouldn’t expect any more or less of it.
Jeff_Emanuel
54
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Meaning of `isless`, `<`, `cmp`, `isequal`, `==`, total order, partial order, unordered | 24 | 2463 | January 7, 2018 | |
| Sortperm with keyword lt = !isless throws BoundsError | 9 | 582 | January 8, 2023 | |
| Behavior of == when isless or < is defined | 22 | 2272 | April 4, 2018 | |
| What should `issorted` return when an order isn't defined for the elements, but a comparison works? | 4 | 272 | July 10, 2023 | |
| Why is there no isless(::Int64, ::UnitRange{Int64})? | 45 | 1237 | April 9, 2025 |