Sort a List of Functors
Posted: 24 Jun 2022 11:57
Hello everybody
please, is there someone who can teach me How can I sort a list of functors based on the fourth atom? For instance, if I have the following list[p('a', 2.5, 2, 4), p('b', 7.5, 3, 1)], then the sorted copy of this list, in ascending order, would be [p('b', 7.5, 3, 1), p('a', 2.5, 2, 4)].
please, is there someone who can teach me How can I sort a list of functors based on the fourth atom? For instance, if I have the following list[p('a', 2.5, 2, 4), p('b', 7.5, 3, 1)], then the sorted copy of this list, in ascending order, would be [p('b', 7.5, 3, 1), p('a', 2.5, 2, 4)].