What is the difference between the semantics of copying in
Ada from the semantics of copying in C++?
What is aliasing, and how can it occur?
What is locally imperative programming, and how does
it differ from globally imperative programming?
In the following C++ function definition, write an @
at each point where the compiler will insert an implicit dereference.
A dereference is a fetch of the contents of a box.
int test( int x)
{
int y, a[ 20];
y = x;
a[ y] = 40;
return a[ y];
}
The effect of call-by-reference can be achieved by passing
a pointer, or a box, using call-by-value. Explain how.
Scheme is a typeless language. Briefly, what does
that mean?
Write a function to test whether a value is a member of a
list in Scheme. (member x L) should return #t if x is in L and
#f if x is not in L. Use function eq? to do the equality tests.
What is the most general polymorphic type of
function f defined by f(x) = head(left(x))?
Use alpha and beta as type variables.
Use notation [alpha] for the type
"list of alpha" and (alpha,beta) for the type of
ordered pairs whose left-hand member has type alpha and
whose right-hand member has type beta.
What is the most general polymorphic type of the
function f defined by f(x) = head(head(x))? Use the same
conventions as in the previous question.
Why is polymorphism so important that most modern typed
programming languages have at least some facility to support it?
Specifically, where is polymorphism most important?
What is the difference between name equivalence and structural
equivalence of types?