Next: Tail Calls, Up: About Expressions [Contents][Index]
In Scheme, the process of executing an expression is known as evaluation. Evaluation has two kinds of result:
Of the expressions that we have met so far, define
and
set!
expressions have side effects — the creation or
modification of a variable — but no value; lambda
expressions
have values — the newly constructed procedures — but no side
effects; and procedure invocation expressions, in general, have either
values, or side effects, or both.
It is tempting to try to define more intuitively what we mean by “value” and “side effects”, and what the difference between them is. In general, though, this is extremely difficult. It is also unnecessary; instead, we can quite happily define the behaviour of a Scheme program by specifying how Scheme executes a program as a whole, and then by describing the value and side effects of evaluation for each type of expression individually.
So, some1 definitions…
2.3
or a string
"Hello world!"
The following subsections describe how each of these types of expression is evaluated.
• Eval Literal | Evaluating literal data. | |
• Eval Variable | Evaluating variable references. | |
• Eval Procedure | Evaluating procedure invocation expressions. | |
• Eval Special | Evaluating special syntactic expressions. |
These definitions are approximate. For the whole and detailed truth, see R5RS syntax in The Revised(5) Report on the Algorithmic Language Scheme.
Next: Tail Calls, Up: About Expressions [Contents][Index]