Page:AIM-453.djvu/25

 get a single element.

We could simply add more procedural parameters to MAPCAR:

Using this, we can make a copy of the list L:

We can simulate (MAPCAR F L):

Indeed, we can write:

We can sum the elements of L:

We can take the product of the elements of L:

We can count the pairs of duplicate elements of L:

If we have occasion to take the sum over lots of lists in different places, we might want to package the operation "sum over list" — we get awfully tired of writing "CAR + 0". We can write:

The result of (MAPGEN CAR + 0) we might call SUM — it is a procedure of one argument which will sum the elements of a list. The reason we wrote a procedure to SUM, rather than just writing: