The reason why it is "cons 1 cons 2 cons 3 nil" and not "cons 3 cons 2 cons 1 nil" for the list 1 2 3 is because of the way lists are constructed in Lisp and other programming languages.
In Lisp, the "cons" function is used to create a new list by combining two elements. The first element becomes the head of the list and the second element becomes the rest of the list.
When constructing a list, the first element to be added is typically the last one in the final list. This is because each element is added to the front of the list, which means that the last element added will be at the front of the list, and the first element added will be at the end of the list.
So in the case of the list 1 2 3, we would start with an empty list, represented by "nil". We would then use the "cons" function to add the element 3 to the front of the list, like this:
(cons 3 nil)
This would create a new list with 3 as the head and nil as the rest, or in other words, a list with just one element, 3.
Next, we would add the element 2 to the front of this list, using the "cons" function again:
(cons 2 (cons 3 nil))
This would create a new list with 2 as the head and (3) as the rest, or in other words, a list with two elements, 2 and 3.
Finally, we would add the element 1 to the front of this list:
(cons 1 (cons 2 (cons 3 nil)))
This would create a new list with 1 as the head and (2 3) as the rest, or in other words, a list with three elements, 1, 2, and 3.
So, the reason why it is "cons 1 cons 2 cons 3 nil" and not "cons 3 cons 2 cons 1 nil" for the list 1 2 3 is because we are adding each element to the front of the list, which means that the first element added will be at the end of the list, and the last element added will be at the front of the list.