98 terms

Programming Language Concepts Final Exam

STUDY
PLAY

Terms in this set (...)

Associative Array
An ____ _____ is an unordered collection of data elements that are indexed by keys.
Keys
An Associative Array is an unordered collection of data elements that are indexed by _____.
Hashes
In Perl, associative arrays are called _____ because their elements are stored and retrieved with hash functions.
Dictionaries
Python's associative arrays (_____) are similar to Perl's hashes, except that the values are references to objects.
Tables
Lua's associative arrays (_____) are the only data structure in the language.
Record
A _____ is a data structure in which individual elements are identified by names.
Fields
The fundamental difference between a record and an array is that record elements (_____) are not referenced by indices.
Level Numbers
The _____ _____ 01, 02, and 05 indicate levels of nesting
Dot Notation
With ______ _____ the name of the largest enclosing record comes first;
Fully Qualified Reference
A _____ _____ _____ to a record field is one in which all intermediate record names, from the larges enclosing record to the specific field, are named.
Elliptical References
COBOL also allows _____ _____ to record fields. In an elliptical reference, the field is named, but any or all of the enclosing record names can be omitted, as long as the resulting reference is unambiguous.
Tuple
A _____ is a data type that is similar to a record, except that the elements are not named.
List
_____ have always been part of functional languages, but in recent years they have found their way into some imperative languages.
List Comprehensions
_____ _____ are powerful mechanism for creating lists. They are derived from set notation. They first appeared in Haskell.
Union
A _____ is a type whose variables may store values of different types at different times during program execution.
Free Unions
Unions in C++ and C are called _____ _____ because of the freedom allowed in their use.
Tag or Discriminant
Each union includes a type indicator known as a _____
Discriminated Union
A union with a discriminant is called a _____ _____
Pointer
The values of a _____ type consist of memory addresses and a special value.
Nil
_____ is not a valid address; it indicates that a pointer cannot currently be used to reference any memory cell
Dangling Pointer/Reference
A _____ _____ is a pointer that contains the address of a heap-dynamic variable that has been deallocated.
Lost Heap-Dynamic Variable
_____ _____ ____ is a heap-dynamic variable that is no longer accessible to a program.
Memory Leakage
The problem of lost-heap dynamic variables is sometimes called _____ _____
Garbage
A variable that is no longer accessible to a program is sometimes called _____ because they are no longer useful, yet the space the occupy cannot be reallocated.
Reference Type
A value of a _____ _____ is similar to a pointer, except that it must refer to an object or other value in memory.
Reference Counters (eager approach)
Reclamation is incremental and is done when inaccessible cells are created.
Mark-Sweep (lazy approach)
Reclamation occurs only when the list of available space becomes empty.
deferred reference counting
The time required to maintain reference counters can hurt the performance of a program. Performance can be improved by _____ _____ _____, which avoids reference counters for some pointers.
Incremental mark sweep
_____ _____ _____ garbage collection occurs more frequently, long before memory is exhausted. This strategy is more effective at reclaiming storage and reduces the delay in application execution.
Type Checking
_____ _____ is the activity of ensuring that the operands of an operator are of compatible types
Compatible
A _____ type is one that is either legal for the operator or is allowed under language rules to implicitly converted to a legal type
Coercion
Conversion of an compatible type is called _____
Type Error
A _____ _____ is the application of an operator to an operand of an inappropriate type
Dynamic Type Checking
Dynamic type binding requires type checking are run time, which is called _____ _____ ____
Strong Typing
One of the ideas in language design that became prominent in the 1970s was _____ _____
Strongly Typed
A programming language is _____ _____ if type errors are always detected, either at compile time or at run time.
Structure type equivalence
Variables have ______ ______ _____ if their types have identical structures.
Name type equivalence
Variables have equivalent types if they are defined either in the same declaration or in declarations that use the same type name.
Equivalent
Two types are _____ if an operand of one type can be substituted for one of the other type without coercion
Derived Type
A _____ _____ is derived from an existing type
Subtype
An ADA _____ is possible range-constrained version of an existing type
Unary
One operand
Binary
Two operands
Ternary
Three operands
Infix
Binary operators appearing between their operands
Prefix
Binary operators appearing before their operands
Postfix
Binary operators appearing after their operands
Identity Operator
Unary plus is called the _____ _____ because it usually has no effect.
Associativity
When an expression contains adjacent occurences of operators with the same precedence, _____ rules determine which operator is evaluated first.
Side Effect
A _____ _____ occurs when an operator or function call performs some other action in addition to returning a value
Referential Transparency
A program has the property of _____ _____ if any two expressions with the same value can be substituted for each other without affecting the programs behavior.
Operator Overloading
_____ _____ is usually considered acceptable as long as neither readability nor reliability suffers.
Narrowing Conversion
A _____ _____ converts a value to a type that cannot store even approximations of all the values of the original type.

Ex. Converting a double to a float
Widening Conversion
A _____ converts a value to a type that can include at least approximations of all the values of the original type.

Exp Converting int to a float
Mixed-Mode Expressions
Languages that allow ____ _____ must define rules for coercions, because computers do not have binary operations that take operands of different types
Overflow
The result of an operation is too large to store in the designated amount of memory
Underflow
The result of an operation is too small to represent. Division by zero.
Exception
Division by zero generates a run-time error or _____ in most languages, but under and overflow may go undetected
Relational Operator
____ _____ compares the values of its two operands
Short-Circuit Evaluation
With ______ _____ the value of an expression is determined without evaluating all of its subexpressions
Compound Assignment Operator
A _____ _____ _____ combines assignment with some other operation

Ex. sum += value
Control Statements
Statements that give programs the capability to select from among alternative control flow paths and repeatedly execute sequences of statements are called ____ _____
Control Structure
A _____ _____ is a control statement and the collection of statements whose execution it controls
Selection Statement
A _____ _____ provides a way of choosing between two or more execution paths in a program
Multiple Selection
A _____ _____ statement allows the selection of one of any number of statements or statement groups
Branch Table (Jump Table)
The indices of the table are the case values.
The elements of the table are the segment labels.
Elements whose indices are not case values contain the default label.
Finding the matching case is done by array subscripting.
Iterative Statement (Loop)
A _____ _____ causes a statement or collection of statements to be executed zero, one or more times
Body
The _____ of a loop is the collection of statements whose execution is controlled by an iterative statement
Pretest
A _____ loop tests the condition for loop completion before the loop body is executed
Postest
A ____ loop tests the condition for loop completion after the loop body is executed
Loop Variable
A counter-controlled loop have a _____ _____ in which the count is stored
Loop Parameters
A counter controlled loop has _____ _____
Initial
_____ is a value of the loop variable
Terminal
_____ is the vale of the loop variable
Step Size
_____ is the difference between sequential values of the loop variable
Iterator
Another kind of iterative statement uses an _____ to traverse the elements of a data structure
Block
In Ruby, a _____ is a sequence of code delimted by either braces or the do and end reserved words
Unconditional Branch Statement
An _____ _____ _____ or goto transfers control to a specified location in a program
Subprogram Definition
A _____ _____ describes the interface to a subprogram as well as the actions of the subprogram
Subprogram call
A _____ _____ is an explicit request that a specific subprogram be executed
Active
A subprogram is _____ if it has been called but has not yet returned
Subprogram header
A _____ _____ the first line of a definition, serves serves several purposes
Parameter Profile
The _____ _____ of a subprogram specifies the number, order, and types of its formal parameters
Protocol
The _____ of a subprogram is its parameter profile plus, if it is a function, its return type
Prototypes
Function declarations are called _____ in C and C++. Such declarations are often places in header files
Formal Parameters
The parameters in a subprogram header are called _____ _____
Actual Parameters
A subprogram call specifies the name of the subprogram and a list of _____ _____ to be bound to the subprograms formal parameters
Positional Parameters
The correspondence between actual and formal parameters is done by position: The first actual parameter is bound to the first formal parameter and so forth.
Keyword Parameters
_____ _____ are names of formal parameters that are explicitly connected with actual paramters
Local Variables
Subprograms can be define their own variables called _____ _____
In Mode
Data is received from the corresponding actual parameter
Out mode
Data is sent to the actual parameter
Inout mode
Data is both send and received
Pass-By-Value
The value of the actual parameter is used to initialize the corresponding formal parameter. Is normally implemented by copy.
Pass-By-Result
A _____ formal parameter behaves like a local variable. Just before control returns to the caller, the parameter's value is copied to the caller's actual parameter.
Pass-by-value-result (pass-by-copy)
_____ is a combination of pass-by-value and pass-by result. It is an implementation model for inout-mode parameters in which actual values are moved.
Pass-by-reference
_____ transmits an access path, usually just an address, to the called subprogram.
Pass-by-name
With _____, the actual parameter is, in effect, textually substituted for each occurrence of the corresponding formal parameter.