Chapter 5 Notes

Names, Bindings, Type Checking, and Scopes

§ 5.1 Introduction

§ 5.2 Names

T E R M S
identifier
The name of an item in a program.

¶ 5.2.1 Design Issues

 

§ 5.3 Variables

T E R M S
variable
A named data container which can be both read and written in a program.

§ 5.4 The concept of binding

T E R M S
binding
The association of a symbol with a value.
storage class
Property of an object that determines when the object comes into existence and goes out of existence.
Prof. Croker

¶ 5.4.1 Bindings of Attributes to Variables

 

¶ 5.4.2 Type Bindings

 

¶ 5.4.3 Storage Bindings and Lifetimes

 
T E R M S
static variable

§ 5.5 Type Checking

T E R M S

§ 5.6 Strong Typing

T E R M S
strong typing
A typing system which allows all type errors to be detected.
weak typing
A typing system which is not strong.

§ 5.7 Type Equivalence

T E R M S

§ 5.8 Scope

T E R M
scope
The portion of a program in which a particular identifier is visible.

¶ 5.8.1 Static Scope

 
T E R M
static scope
Scope which is determined at compile time.

¶ 5.8.2 Blocks

 
T E R M
block
(1) A section of program code which is syntactically grouped together.
(2) A physical data record, separated on the medium from other blocks by inter-block gaps.

¶ 5.8.3 Evaluation of Static Scoping

 

¶ 5.8.4 Dynamic Scope

 
T E R M
dynamic scope
Scope which is determined at run time.

¶ 5.8.3 Evaluation of Dynamic Scoping

 

§ 5.9 Scope and Lifetime

T E R M S
lifetime
The period during execution of a program in which a variable or function exists.

5.10 Referencing Environments

T E R M S
referencing environment
The collection of all names that are visible in the statement.
Giovanni Valdivia
static referencing environment
The set of all the unique variables declared in the static ancestors of a subprogram or statement.
Amruth N. Kumar
dynamic referencing environment
The set of all the unique variables declared in the dynamic ancestors of a subprogram or statement.
Amruth N. Kumar

§ 5.11 Named Constants

T E R M S
constant
A value that cannot change;
Gordon S. Novak Jr.
named constant
A variable whose value cannot be changed by the program after initialisation.
Derek Bridge
literal constant
A lexical token that directly represents a scalar value of intrinsic type.
IBM
manifest constant
A symbolic constant with a predefined value.
soft coding
The use of named constants in program code.
hard coding
The use of literal constants in program code.

Terms

binding
block
constant
dynamic referencing environment
dynamic scope
hard coding
identifier
lifetime
literal constant
manifest constant
named constant
referencing environment
scope
soft coding
static referencing environment
static scope
static variable
storage class
strong typing
variable
weak typing

See Also

C++ Now   C++ Variables

External Links

not a bug Manifest Constants

See Also

Chapter 4   Lexical and Syntax Analysis
Chapter 6   Data Types

copyright 2007, j.h.young, revised 10/16/2007 Site Logo