Next: , Previous: Variables, Up: List Processing

1.8 Arguments

To see how information is passed to functions, let's look again at our old standby, the addition of two plus two. In Lisp, this is written as follows:

     (+ 2 2)

If you evaluate this expression, the number 4 will appear in your echo area. What the Lisp interpreter does is add the numbers that follow the +.

The numbers added by + are called the arguments of the function +. These numbers are the information that is given to or passed to the function.

The word `argument' comes from the way it is used in mathematics and does not refer to a disputation between two people; instead it refers to the information presented to the function, in this case, to the +. In Lisp, the arguments to a function are the atoms or lists that follow the function. The values returned by the evaluation of these atoms or lists are passed to the function. Different functions require different numbers of arguments; some functions require none at all.1


Footnotes

[1] It is curious to track the path by which the word `argument' came to have two different meanings, one in mathematics and the other in everyday English. According to the Oxford English Dictionary, the word derives from the Latin for ‘to make clear, prove’; thus it came to mean, by one thread of derivation, `the evidence offered as proof', which is to say, `the information offered', which led to its meaning in Lisp. But in the other thread of derivation, it came to mean `to assert in a manner against which others may make counter assertions', which led to the meaning of the word as a disputation. (Note here that the English word has two different definitions attached to it at the same time. By contrast, in Emacs Lisp, a symbol cannot have two different function definitions at the same time.)