Previous Up Next

5.40.18  Sort : sort

sort takes as argument a list or an expression.

sort accepts an optional second argument, which is a bivariate function returning 0 or 1. If provided, this function will be used to sort the list, for example (x,y)->x>=y may be used as second argument to sort the list in decreasing order. This may also be used to sort list of lists (that sort with one argument does not know how to sort).
Input :


Output :


Previous Up Next