|
Example Dictionary sort 004
|
Description
These examples show how the sort function sorts the
elements of the Dictionary by comparing its keys. These examples
use the (sort dictionary predicate ) without the optional keywords.
Details
Sort a Dictionary by keys in descending order.
(sort #{dic|A: 2 B: 3 C: 1} >)
|
Returns: #<Dictionary 123456>
|
(display #<Dictionary 123456> )
|
Returns: #{dic|C: 1 B: 3 A: 2}
|
Sort a Dictionary by keys in ascending order.
(sort #{dic| C: 2 F: 3 F: 1 A: 4 G: 2 C: 5} <)
|
Returns: #<Dictionary 234567>
|
(display #<Dictionary 234567>)
|
Returns: #{dic|| A 4 C 5 F 1 G 2}true
|
Notes and Hints
Only the keys are sorted. No regard is given to the value even if the
keys are equal.
Related Examples
Here are examples of the sort function at work.
Function Links
Here is the link to the current function used in this example.
sort
Here are a number of links to other related functions.
Argument Types
Here are the links to the data types of the arguments used in this example.
Here are a number of links to examples having similar argument types.
|
Analytic Information Server (AIS)
AIS Component Systems
- Smartbase Engine
- QT C++ Libraries
- MySQL Relational Database
- AIS Lisp Libraries
- Rapid Analytic Demo IDE
|