Sort is destructive, which is why you are seeing any change in the value
of the variable. You are expecting that; i.e. you expect sort to change
the list in place. Just not the surprising results of seeing just part
of the list.
Sort can work in three possible ways (or any mixture thereof):
1. It can keep the list structure exactly the same, and move the values
among the list's cells. If that is the case, you will see the
naively expected behavior that the value of the variable will hold
a sorted list.
2. It can keep elements in their respective cells but rearrange the
cells into a different shape.
3. It can allocate new cells.
Only if a sort implementation strictly followes destructive approach
(1), would you get the expected behavior that the variable turns into
the sorted list.
Because (2) and (3) are allowed, you must capture the return value of
sort (and store it into the variable). Only the return value is
required to be the sorted list. The original head cons cell passed into
the function is not required to be the head of the sorted list,
and, additionally, may be altered.