A Fourth Programming Assignment
A Bit of LISP
Write a set of functions that operate on lists as discussed in
Part 8-5
.
In particular write functions to:
-
Return the number that is stored at the front of the list.
Call it
car()
.
-
Return a pointer to the rest of the list after the first element.
Call it
cdr()
.
-
Return a new list that consists of an element prepended to the
front of a list.
Call this function
cons()
.
It will take two arguments, the element to prepend and a list to prepend
it to.
You may now move on to the
next lesson
or
return to the
index
.