Renderingen-US

Experimental through version 1. Version 0 was alpha. This is the first language release: the interface is relatively stable, not frozen. Nothing is promised stable until version 2.

sort-set

Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.

Syntax:

Category#

collection

None.

Examples#

radix/corpus/sort/set-asc-desc.fab (canonical · concept)#

# A set sorts into a list; the set itself is unchanged.
main {
    mut set<int> s ← empty
    s.add(7)
    s.add(3)
    s.add(5)
    s.add(1)
    print sort via asc from s
    print sort via desc from s
    print s.length()
}

Expected output:

[1, 3, 5, 7]
[7, 5, 3, 1]
4