Terms.
Know the following terms, all of which are
in the index of the text or in notes I've provided. Be able
to define them
What does the following code return when
Explain your answers.
Simple example. Consider:
let x = 1 in
let p = proc(y) +(x,y) in
let x = 100 in
p(0);
What value does (foo 17) return? Explain your answer.
Describe the closure for the following procedure X.
Define a datatype to represent X.
Use a given datatype to do X.
(define-datatype bintree bintree?
(leaf (label string?))
(branch (label string?) (left bintree?) (right bintree?)))
Define a procedure preorder that given
a bintree argument, returns a list of all the labels in
the tree in preorder.
Given a BNF definition for concrete syntax, a define-datatype definition for abstract syntax, and a specific piece of concrete syntax, draw the corresponding abstract-syntax tree.
Write a Scheme procedure to do X. (Where X is something not too involved.)
For samples, see the problems in EOPL chapter 1.
Given the following Scheme definitons, what are the values of the following expressions.
For an example, see Question 1 of Exam 1.
Add the following feature to the LETREC interpreter, where
the question provides the concrete and abstract syntax for the
feature and also the code for LETREC's value-of
procedure.
max
such that max(exp1,exp2) returns the maximum of the
values of exp1 and exp2.
case expression similar to Java's.