Review Question
1. What are the design issues for names?
– Are names case sensitive?
– Are the special words of the language reserved words or keywords?
2. What is the potential danger of case-sensitive ?
if the variables have the similar meanings, such as, “Rose” with “rose”, in case-sensitive, there is no connection between them, case-sensitive violates the design principle that language constructs that look similar should have similar meanings.
7. define binding and binding time.
binding -> an association between an attribute and an entity, such as between a variable and its type or value, or between an operation and a symbol. Binding can take place at language design time, or run time.
binding time -> the time at which a binding takes place.
13. Define lifetime, scope, static scope, and dynamic scope.
lifetime -> the time during which the variables is bound to a specific memory location.
scope -> the range of statements in which the variable is visible.
static scope -> the scope of a variable can be statically determined – that is, prior to execution. it permits a human program reader and also a compiler to determine the type of every variable in the program simply by examining its source code.
dynamic scope -> based on the calling sequence of subprograms, not on their spatial relationship to each other, the scope can be determined only at run time.
18. What is a block?
A block is a section of code that allows to have its own local variables whose scope is minimized and the variables are typically stack dynamic. Blocks provide the origin of the phrase block-structured language.
19. What is the purpose of the let constructs in functional languages?
This let constructs have two parts, which is to bind names to values, usually specified as expressions and also an expression that uses the names defined in the bind names, rather than statements.
Problem Set
- Decide which of the following identifier names is valid in C language. Support your decision.
. . . <-1 p=””>
. . . <-2 p=””>
. . . <-3 p=””>
. . . <-4 p=””>