4 - Static Scoping Flashcards

(8 cards)

1
Q

range of statements in which a variable is visible and can be referenced

A

scope

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

determines where a variable can be accessed or modified in a program

A

scope

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

scope is determined before execution at compile time

A

static scoping/lexical scoping

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

when a variable with the same name is declared in a nested block, it hides the outer variable

the outer variable can still be accessed using a qualified name

A

variable hiding/shadowing

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

TRUE OR FALSE: Pascal uses static/lexical scoping

A

TRUE

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

section of code that introduces a new scope for variables

A

block

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

TRUE OR FALSE: variables declared in a block are created upon block creation and are deleted upon block deletion

A

TRUE

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

TRUE OR FALSE: in Python, indentations are blocks

A

TRUE

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