sort

sort given block in ascending order


Parameters

sort collection :literal :dictionary :block

Attributes

as:literallocalized by ISO 639-1 language code
sensitivecase-sensitive sorting
descendingsort in descending order
asciisort by ASCII transliterations
valuessort dictionary by values
by:string, :literalsort array of dictionaries by given key

Returns

  • :block
  • or  :nothing

Examples

copy
a: [3 1 6] print sort a ; 1 3 6

copy
print sort.descending a ; 6 3 1

copy
b: ["one" "two" "three"] sort 'b print b ; one three two

Related