Bindings and Scope Flashcards
What is a binding?
A fixed association between an identifier and an entity.
What is an environment?
A set of bindings.
What is a scope?
The portion of the program text over which a declaration has effect.
What is a block structure?
The way in which blocks are arranged in a program text. Can be monolithic, flat or nested.
It delimits the scope of any declaration.
What is a binding occurrence of an identifier I?
An occurrence of I where it is bound to some entity e.
What is an applied occurrence of an identifier I?
An occurrence where use is made of some entity e to which I is bound.
e.g. making use of a global variable in main()
What is a statically scoped PL?
A PL in which a procedure is execute in the same environment where it is defined.
- decide at compile-time which binding occurrence corresponds to a given applied occurrence
e. g. mostly all PLs are statically scoped
What is a dynamically scoped PL?
A PL in which a procedure is executed in the environment of the call site.
- decide at run-time, environment may vary
What is a declaration?
A program construct that will be elaborated to produce bindings.
What is a definition?
A declaration whose only effect is to produce bindings.