previous
|
index
|
next
Simulating cons
To cons an integer onto a list
lst
, we must:
Dynamically create a new list item structure
Set its first member to the integer
Set its second member to
lst
Return a pointer to the new list item structure
list cons(int i, list lst) { }
previous
|
index
|
next