I have the list in LISP:
((1 b) (1 a) (2 D) (1 z) (1 t) (2 a) (3 n))
I have to order it first on the number and if equal on the lexichographic order of the char, the output should be:
((1 a) (1 b) (1 t) (1 z) (2 a) (2 d) (3 n))
I have tried to sort on one parameter and then the other, how can I compose the two function ?
;;(sort '((1 b) (1 a) (2 D) (1 z) (1 t) (2 a) (3 n)) #'< :key #'car )
;;(sort '((1 b) (1 a) (2 D) (1 z) (1 t) (2 a) (3 n)) #'string< :key #'second )
Are there easier ways to do it?
Thanks