RosettaCodeData/Task/Sort-an-array-of-composite-structures/Tcl/sort-an-array-of-composite-structures.tcl
2023-07-01 13:44:08 -04:00

3 lines
105 B
Tcl

set people {{joe 120} {foo 31} {bar 51}}
# sort by the first element of each pair
lsort -index 0 $people