Lecture overview -- Keyboard shortcut: 'u'  Previous page: Examples of expressions and their values -- Keyboard shortcut: 'p'  Next page: Arithmetic expressions -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home    Lecture 2 - Page 7 : 46
Functional Programming in Scheme
Expressions, Types, and Functions
Evaluation of parenthesized expressions

Here we will emphasize the rules of evaluating a form like (a b c d e) in Scheme

How is the form (a b c d e) evaluated in Scheme?
The form (a b c d e) appears as a pair of parentheses with a number of entities inside. The question is how the parenthesized expression is evaluated, and which constraints apply to the evaluation.

  • Evaluation rules

    • The evaluation of the empty pair of parentheses ( ) is in principle an error

    • If a is the name of a special form, such as lambda, if, cond, or define special rules apply

    • In all other cases:

      • Evaluate all subforms uniformly and recursively.

      • The value of the first constituent a must be a function object. The function object is called with the values of b, c, d, and e as actual parameters.

The evaluation of the empty pair of parentheses ( ) is often - in concrete Scheme systems - considered as the same as '( ), which returns the empty list. However, you should always quote the empty pair of parentheses to denote the empty list.