refers to the range of statements in which a variable is visible and can be referenced
scope
determines where a variable can be accessed or modified in a program
scope
what type of scope is determined at compile-time (before execution)
static scope
static scope was introduced in which programming language?
ALGOL 60
on static scoping:
__ can access variables from their enclosing (outer) scopes unless shadowed
inner blocks
refers to when a variable with the same name is declared in a nested block which hides the outer variable
variable hiding and static ancestors
on variable hiding and static ancestors:
the __ can still be accessed using a qualified name
outer variable
refers to a section of code that introduces a new scope for variables
block
variables declared in a block are created when __ and destroyed when __
the block is entered,
the block is exited
true or false:
block-structured languages allow local variable declarations within blocks
true
true or false:
the variable inside a block disappears when the block finishes
true, the variable has a limited lifetime
__ enables clear visibility rules and is efficient to implement
static scoping
problems that are caused by having too much access to variables (3)
problems of static scoping (5)