What is the purpose of level numbers in COBOL records?
They indicate the hierarchical structure of the record.
Define fully qualified and elliptical references to fields in records.
Fully qualified: Names all enclosing records from the largest down to the specific field.
Elliptical: Names the field but omits some enclosing record names (as long as it is unambiguous).
What is the primary difference between a record and a tuple?
A tuple is similar to a record, except that the elements are not named.
Are the tuples of Python mutable?
No, Python tuples are immutable.
What is the purpose of an F# tuple pattern?
It is used on the left side of a let statement to assign values to a sequence of names from a tuple (multiple assignment).
In what primarily imperative language do lists serve as arrays?
Python.
What is the action of the Scheme function CAR?
It returns the first element of its list parameter.
What is the action of the F# function tl?
It returns the tail of the list (the list minus the first element).
In what way does Scheme’s CDR function modify its parameter?
It does not modify the parameter; it returns a new list consisting of the parameter list minus its first element.
On what are Python’s list comprehensions based?
They are based on set notation and the Haskell language.
Define union, free union, and discriminated union.
Union: A data type whose variables may store different type values at different times.
Free union: A union with no language support for type checking (no tag).
Discriminated union: A union that includes a type indicator to allow type checking.
What are the design issues for unions?
The issues are whether type checking should be required and whether unions should be embedded in records.
Are the unions of Ada always type checked?
Constrained variant records are checked statically; unconstrained are checked dynamically.