Bindings and Scope Flashcards

1
Q

What is a binding?

A

A fixed association between an identifier and an entity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an environment?

A

A set of bindings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a scope?

A

The portion of the program text over which a declaration has effect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a block structure?

A

The way in which blocks are arranged in a program text. Can be monolithic, flat or nested.
It delimits the scope of any declaration.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a binding occurrence of an identifier I?

A

An occurrence of I where it is bound to some entity e.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is an applied occurrence of an identifier I?

A

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()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a statically scoped PL?

A

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a dynamically scoped PL?

A

A PL in which a procedure is executed in the environment of the call site.
- decide at run-time, environment may vary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a declaration?

A

A program construct that will be elaborated to produce bindings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a definition?

A

A declaration whose only effect is to produce bindings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly