|
sort
|
The sort function returns a sorted copy of the specified
Structure, Dictionary, Directory, Vector, Matrix, Pair or List argument
{target} in the order specified by the argument predicate {predicate}.
If the optional Boolean argument {true} is present, the sort function does not
sort the specified target; but instead, returns a sorted integer vector of indices
into the specified target.
When to use The sort function sorts all the elements in a vector and returns the sorted
version of the Vector. The sort function is destructive except for the option
containing the keyword {true}, which returns a new sorted integer vector.
(sort vector predicate ) (sort vector predicate true)) The sorted Vector.
Here are a number of links to Lambda coding examples which contain this instruction in various use cases.
Here are the links to the data types of the function arguments. Here are also a number of links to functions having arguments with any of these data types.
You can always talk with the AIS at aiserver.sourceforge.net.
Name
Description
AIS Types vector The vector to be sorted Vector FltVector ShortVector IntVector NumVector ObjVector BitVector predicate predicate > means sort in descending order, predicate < means sort in
ascending order true Optional argument: If present it means to return an integer vector
containing sorted indices to the vector. Boolean
Returns:
Examples
Argument Types
Structure
Dictionary
Directory
List
NumMatrix
ShortVector
Matrix
Vector
String
Text
Integer
Boolean
How do I contact the AIS team?