[top][index]
search for:

rsort -- sort a list in reverse order

rsort v -- produces a reverse sorted version of the list v.

The rsort function uses <= to compare elements of the list, which in turn calls upon ?.

i1 : rsort {g,d,w,s,c,a,r}

o1 = {a, c, d, g, r, s, w}

o1 : List
i2 : rsort {4,2,3,1}

o2 = {4, 3, 2, 1}

o2 : List

Note: we have modified the sort order for strings so that symbols come before alphanumeric characters, and upper and lower case characters are sorted together.

See also:

  • sort -- sort a list
  • <= -- less than or equal
  • ? -- comparison operator

  • [top][index]
    search for: