1/23
Looks like no tags are added yet.
Scope
range of statements in which the variable is visible
Scope
a variable is visible in a statement if it can be referenced in that statement
Block
section of code that may have their won stack-dynamic variables, and usually defines a scope
Local Variables
variables that are declared on the current block
Global Variable
can be accessed at any given point at any given time within the entirety of the program
Nonlocal Variable
variables that are visible to a block but is not declared there
Static and Dynamic Scoping
two types of scoping
Static scoping
scope of a variable is statically determined
Static scoping
allows the support for nested subprograms, program blocks and class definitions
Static parent
enclosing block where the current block is written
Static ancestor
all enclosing blocks of the current block
Enclosing block
every time a variable is used, the _ _ is checked
Static ancestor
if the variable is not found, the _ _ are searched
Dynamic Scoping
variable scope is determined by the sequence of calls to the subprograms
Dynamic Parent
the subprogram that called the current subprogram
Dynamic Ancestor
all subprogram calls that led to the current subprogram
Same Variable
variable name may not refer to the _ _, disadvantage of dynamic scoping (1)
Statistically
some attributes cannot be determined _, disadvantage of dynamic scoping (2)
Harder to read
source code may be _ _ _ , disadvantage of dynamic scoping (3)
Nonlocal variables
access to _ _ are slower, disadvantage of dynamic scoping (4)
Not Equal
Lifetime and Scope are _ _
Referencing Environment
collection of all variables visible in a statement
Only Once
named constants, variables bound to a value _ _
Initialization
binding of a value to a variable upon storage binding