Scoped Identifiers



next up previous contents index
Next: Scoping Units Up: ScopesDeclarations, and Previous: ScopesDeclarations, and

Scoped Identifiers

There are two kinds of scoped identifiers in Theta: equated identifiers and variables. An equated identifier is immutable and denotes the same object for its entire lifetime. A variable is mutable; it can be modified so that it denotes a different object. When a variable is created, it may not denote any object.

Equated identifiers are introduced by equates (4.6), type specifications (9.2), routine implementations (10.2), method implementations (10.4), formal parameter declarations (9.3), classes (10.4), and superclass declarations (10.5). Variables are introduced by declarations (4.5), instance variable declarations (10.4), formal argument declarations (10.2), and special declaration forms in the tagcase (8.11) and typecase statements (8.12).

An equated identifier has a scope that is the entire scoping unit containing the construct that introduces it, while a variable has a scope from its declaration to the end of the containing scoping unit.



theta-questions@lcs.mit.edu