I have a finite list of quadruples, e.g.
(list (list 1 3 5 5) (list 2 3 4 9) (list 3 4 4 6)(list 4 7 10 3)).
I denote each of the elements by (a1 a2 a3 a4).
Please help me to write a sorting function which provides a "increasing" list created according to the following criteria:
- the numbers a2,
- later the difference (a3 - a4),
- and later the numbers a3.
Please help if you can.
As far as I can tell, your ordered criteria are the order in which to sort. If this is the case, then the following program should perform that sorting.