2.26 Exercise 2.26
> (define x (list 1 2 3)) > (define y (list 4 5 6)) > (append x y) (mcons 1 (mcons 2 (mcons 3 (mcons 4 (mcons 5 (mcons 6))))))
We get this result because append takes two lists and returns a new list containing all the items from the first list followed by all the items from the second list.
> (cons x y) (mcons (mcons 1 (mcons 2 (mcons 3))) (mcons 4 (mcons 5 (mcons 6))))
We get this result because cons creates a pair where the first element points to the list (1 2 3) and is is the valid list (4 5 6).
> (list x y) (mcons (mcons 1 (mcons 2 (mcons 3))) (mcons (mcons 4 (mcons 5 (mcons 6)))))
We get this result because list creates a list structure where the first element is the list (1 2 3) and the second element is the list (4 5 6).