I am new to Lisp and I want to learn Lisp programming. I want to sort some lists read from a text file, for example, 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 whole element or perhaps the second or third, etc.?
I have the following idea:
- read them all and put them on the list of lists.
- iterate over the list of containers and compare the values โโof the list with the following, as in sorting bubbles.
Are there more suitable data structures to achieve this, maybe like collections in Java that automatically match comparable objects that contain sorting and full sorting?
Many thanks.
Erhan bagdemir
source share