Chapter 5 Flashcards

1
Q

What are the design issues related to names?

A
  • Length
  • Connector characters
  • Case sensitivity
  • Reserved words or keywords
  • Some languages require the use of special characters to start their variables
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the sextuple of attributes for a variable?

A
  • Name
  • Address
  • Value
  • Type
  • Scope
  • Lifetime
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When considering the address of a variable, what is an alias?

A

Multiple names for the same address.

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

What are the two broad categories of binding?

A
  • Static binding: Permanent assignment of an address during the execution of a program
  • Dynamic binding: The address can change during execution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is scope?

A

Where it is legal to reference a variable.

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

What is lifetime?

A

How long a variable exists in memory.

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

How is static scope used to determine the value of a variable?

A

The value of the variable is determined prior to execution.

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

How is dynamic scope used to determine the value of a variable?

A

The value is determined by subsequent function calls during runtime.

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

What is a referencing environment and how is it used to determine the value of a variable?

A

The combination of all of the names that are in scope at the point in the code where a name is used.

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