Skip to content

sort! docstring does not document order argument #22382

Open
@nalimilan

Description

Title says it all. That is particularly confusing is that "order" is mentioned twice, but in reference to rev, not to order.

help?> sort!
search: sort! sortperm! sort sortrows sortperm sortcols Cshort issorted

  sort!(v; alg::Algorithm=defalg(v), lt=isless, by=identity, rev::Bool=false, order::Ordering=Forward)

  Sort the vector v in place. QuickSort is used by default for numeric arrays
  while MergeSort is used for other arrays. You can specify an algorithm to
  use via the alg keyword (see Sorting Algorithms for available algorithms).
  The by keyword lets you provide a function that will be applied to each
  element before comparison; the lt keyword allows providing a custom "less
  than" function; use rev=true to reverse the sorting order. These options are
  independent and can be used together in all possible combinations: if both
  by and lt are specified, the lt function is applied to the result of the by
  function; rev=true reverses whatever ordering specified via the by and lt
  keywords.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    docsThis change adds or pertains to documentationgood first issueIndicates a good issue for first-time contributors to JuliasortingPut things in order

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions