What happens to the value of a, after saying (cons 'a a)? Nothing. That is, it looks like this:
Obviously, it would be useful to make these changes stick sometimes. To do that you can use setq as follows:> (cons 'a a) (a a s d f) > a (a s d f)
and henceforth, that is the new value of a.> (setq a (cons 'a a)) (a a s d f) > a (a a s d f)
We'll let you play with the possibilities here, but using setq with just the three functions first, rest, and cons you can do anything you want to with lists. These primitives are sufficient. Append and list are strictly superfluous -- although they are very convenient. For practice, try to achieve the same effects using just first, rest, and cons as in the examples that used append and list, above.
© Colin Allen & Maneesh Dhagat