Scoping Flashcards
of a variable is a range of statements in which the variable is visible.
scope
A variable is visible in a statement if it can be … in that statement
referenced
What are the two scoping rules for name? 1
- Static scoping (Lexical scoping)
- Dynamic scoping
is the method of binding names to nonlocal variables
Static scoping
is based on the calling sequence of subprograms, not on their spatial relationship to each other. Thus, the scope can be determine only at run time
Dynamic scoping
of statement is the collection of all variables that are visible in the statement
referencing environment
is a variable that is bound to a value only once; its value cannot be changed by an assignment or by an input statement
name constant
is the binding of a variable to a value at the time it is bound to a storage
Initialization