Handbook
Glossary
sort-keys ( obj -- sortedseq )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Sorting sequences
Prev:
natural-sort ( seq -- sortedseq )
Next:
sort-values ( obj -- sortedseq )
Vocabulary
sorting
Inputs
obj
an
object
Outputs
sortedseq
a new sorted sequence
Word description
Sorts the elements of
obj
(converting to an alist first if not a sequence), comparing first elements of pairs using the
<=>
word.
See also
compare
,
natural-sort
,
sort-with
,
inv-sort-with
,
sort-values
Definition
IN:
sorting
GENERIC:
sort-keys
( obj -- sortedseq )
Methods
USING:
arrays
assocs
hashtables
kernel.private
sequences.private
sorting
;
M:
hashtable
sort-keys
>alist
[
{
array
}
declare
first-unsafe
]
sort-with
;
USING:
assocs
kernel
sorting
;
M:
object
sort-keys
>alist
sort-keys
;
USING:
sequences
sequences.private
sorting
sorting.private
;
M:
sequence
sort-keys
0
check-bounds
[
first-unsafe
]
sort-with
;