[top][index]
search for:

sort -- sort a list

sort v -- produces a sorted version of the list v.

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

i1 : sort {c,e,a,f,b,f}

o1 = {f, f, e, c, b, a}

o1 : List
i2 : sort {4,2,6,3,8,2}

o2 = {2, 2, 3, 4, 6, 8}

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:

  • rsort -- sort a list in reverse order
  • <= -- less than or equal
  • ? -- comparison operator

  • [top][index]
    search for: