(r5rs.info.gz) Variables; syntactic keywords; and regions
Info Catalog
(r5rs.info.gz) Basic concepts
(r5rs.info.gz) Basic concepts
(r5rs.info.gz) Disjointness of types
3.1 Variables; syntactic keywords; and regions
==============================================
An identifier may name a type of syntax, or it may name a location
where a value can be stored. An identifier that names a type of syntax
is called a _syntactic keyword_ and is said to be _bound_ to that
syntax. An identifier that names a location is called a _variable_ and
is said to be _bound_ to that location. The set of all visible
bindings in effect at some point in a program is known as the
_environment_ in effect at that point. The value stored in the
location to which a variable is bound is called the variable's value.
By abuse of terminology, the variable is sometimes said to name the
value or to be bound to the value. This is not quite accurate, but
confusion rarely results from this practice.
Certain expression types are used to create new kinds of syntax and
bind syntactic keywords to those new syntaxes, while other expression
types create new locations and bind variables to those locations.
These expression types are called _binding constructs_.
Those that bind syntactic keywords are listed in section Macros.
The most fundamental of the variable binding constructs is the `lambda'
expression, because all other variable binding constructs can be
explained in terms of `lambda' expressions. The other variable binding
constructs are `let', `let*', `letrec', and `do' expressions (see
sections Procedures, Binding constructs, and
Iteration).
Like Algol and Pascal, and unlike most other dialects of Lisp except
for Common Lisp, Scheme is a statically scoped language with block
structure. To each place where an identifier is bound in a program
there corresponds a "region" of the program text within which the
binding is visible. The region is determined by the particular binding
construct that establishes the binding; if the binding is established
by a `lambda' expression, for example, then its region is the entire
`lambda' expression. Every mention of an identifier refers to the
binding of the identifier that established the innermost of the regions
containing the use. If there is no binding of the identifier whose
region contains the use, then the use refers to the binding for the
Expressions:: and Standard procedures); if there is no binding
for the identifier, it is said to be "unbound".
Info Catalog
(r5rs.info.gz) Basic concepts
(r5rs.info.gz) Basic concepts
(r5rs.info.gz) Disjointness of types
automatically generated byinfo2html