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
Related#
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