next up previous
Next: Special Forms Up: Functions Previous: Anonymous Functions

Misc stuff about functions

We are not yet done with functions :) At this point, the astute reader should begin to feel a little uneasy, as I seem to have uttered a couple of contradictory things! If the contradiction is not obvious, let me spell it out loud and clear. In the previous section on function calls, I made the claim that in any Type (3) expression, the first expression after the opening bracket is a function and the rest are its arguments, and that before the function call is made all the arguments are evaluated. Further, in the preceding paragraphs, I asserted that the lisp expression declaring a function is a type 3 expression. So, if one were to apply the evaluation logic just explained to a function declaration expression, things do not seem to work too well. Look at the declaration of foo above. We should read the declaration as ``Hm, defun is a function and the remaining expressions in the brackets are all expressions that need to be evaluated in turn. So, first foo is evaluated then () and so on...'' Hm, suddenly the elegance of a lisp function declaration seems to be crumbling. Of course, all this shit does not happen. Why this does not happen is the topic of the next section.


next up previous
Next: Special Forms Up: Functions Previous: Anonymous Functions
Sriram Karra
2005-01-06