Grade: Difference between revisions
Content added Content deleted
m (Lowercase title) |
("Remove lowercase again - it is in the template now") |
||
Line 1: | Line 1: | ||
{{lowercase title}} |
|||
{{primitive|<x<br>>x}} |
{{primitive|<x<br>>x}} |
||
Revision as of 01:30, 9 July 2022
Grade
<x
>x
>x
grade returns the domain of a collection (list, table, or dictionary) sorted by its range. It has two versions: up (<x
) and down (>x
), a.k.a. asc and desc by analogy with SQL.
Grade uses a stable sorting algorithm - equivalent items are sorted in their original order.
Sorting (as in sorting the range by itself) can be implemented through the idiom x@<x
or x@>x
. K7 and k9 support an additional dedicated sort-ascending primitive: ^x
.
>34 -1 0 67 32767 4 3 0 2 1 {x(<x)}("xyz";"a";"k";"j";"apl";"bqn") ("apl" "bqn" "xyz" "a" "j" "k")