|
The exam will cover the first 7 lectures, up to and including the
lecture on Forms of Recursion and Higher-Order Recursive Operators.
The following give examples of
the kinds of questions you are likely to be asked for each topic:
- Basic OCaml
- Know the basic constructs (e.g., match,
fun, let, let rec) like the back of your hand.
- Be able to determine the type of OCaml expressions
- Be able to evaluate OCaml expressions, both
intuitively, and
and step by step following
the steps discussed in class
- Be able to describe the environment that results from
a sequence of declarations
- Be able to describe the closure that is the result of
evalutating a function declaration
- Understand what effect sequencing, function application and
lambda lifting (function expression) has on the
order of evaluation of expressions
- Recursion
- Be able to write recursive functions, including (but
not necessarily limited to)
tail recursive or forward recursive.
- Be able to recognize whether a function is
tail recursive, and when a recursive call is in tail call
position
- Higher Order Functions (HOFs)
- Be able to write the definitions of the common HOFs,
fold_right, fold_left and map.
- Be able to use map and fold to implement other
functions, as in MP3.
- Be able to write functions that use other functions
as arguments
|