dict <-
sort_by: [code]*The method dict<->sort_by
defines the behaviour of dict->insert
as well as the default behaviour of dict->sort.
If its value is @nil,
no sorting is done. dict->insert
and will behave as dict->append.
Using
@default, the
arguments are sorted alphabetically on their printed representation. dict->insert
will insert a new item according to this order. If the dict<-sort_by
contains a code object,
this will be used for comparing the pairs of dict_item
objects. See also chain->sort.
It dict<-sort_by
is assigned another value than @nil, dict->sort
will be activated to establish the desired order.
Using dict->sort_by
is a good technique to insert new items at the right place in the list.
It is not a good technique to build up a sorted list as this will result
in quadratic behaviour for long lists, while dict->sort
uses the QuickSort algorithm.