I'm trying to understand what the difference is between cons and append in terms of how the lists are being stored underneath. consider the case:
(define x '(hi, hello))
(define y '(randomvalue1, randomvalue2))
if I'm assuming that calling
(cons x y) on these two lists will generate a dotted pair
where the first pointer points to x and the second points to y.
all in all neither x or y has been changed. Only thing added memory wise is the dotted pair.
However when I call append with the two lists:
(append x y)
I would assume that in order for racket to avoid changing x and y it will have to create a new list with for entries with copies of the values of x and y in order. This list does not have any pointers pointing to neither x or y.
Are my assumptions correct?