I am a newbie in Lisp and I want to learn Lisp programming. I want to sort some lists read from a text file, like in the following form:
(a 120 135 124 124) (b 120 135 124 124) (c 120 135 124 124)
What is the best way to sort them according to the first integer element or maybe second or third and so on?
I have the following idea:
- read them all and put them into a list of lists
- iterate over the container list and compare the values of list with following one like in bubble sort.
Are there more suitable data structures to achieve this, maybe like Collections in Java which take comparable objects that contain sort logic and fullfill sorting automatically?
Thank you very much.