9 lines
369 B
Plaintext
9 lines
369 B
Plaintext
s@(Sequence traits) tableSort &column: column &sortBy: sortBlock &reverse: reverse
|
|
[
|
|
column `defaultsTo: 0.
|
|
sortBlock `defaultsTo: [| :a :b | (a lexicographicallyCompare: b) isNegative].
|
|
(reverse `defaultsTo: False)
|
|
ifTrue: [sortBlock := [| :a :b | (sortBlock applyTo: {a. b}) not]].
|
|
s sortBy: [| :a :b | sortBlock applyTo: {a at: column. b at: column}]
|
|
].
|