|
|
|
Review for final exam
The final exam will be comprehensive. You can expect about 2/3 of the exam to cover
material introduced after the mid-term, 1/3 covering material previously on the
mid-term.
You may use 1 8 1/2"x11" sheet of notes for the exam. In my opinion many people on
the midterm relied too much on their notes. The underlying principles here are
not difficult. A word or two of notes to assure you that you are thinking
of the right topic might be helpful. But if you are counting on the notes to hold
all the answers you are probably going to be in trouble. Recall that the highest
scores on the midterm were achieved by people who did not use notes.
The outline below lists what I consider to be the highlights of each topic
covered in the second half of the course.
- Scoping
- terms: scope, lifetime, referencing environment, static scoping, dynamic scoping
- implementation of scoping: static and dynamic links;
- be able to mentally simulate execution of procedure calls and name lookups
using different scoping
rules; this includes drawing representations of the stack at various points in the execution
Parameter passing
- terms: pass by value, pass by reference, pass by name, pass by need, aliasing
- be able to simulate procedure calls using any of the pass-by-* rules
- be able to simulate what happens when aliasing occurs using different rules
- Tail recursion
- What is it? Why is it important?
- Be able to distinguish tail-recursive calls from non-tail-recursive calls
- Be able to write a tail-recursive function using an accumulating parameter (discussed when talking about ML and Scheme
- Exception handling
- Know how exceptions are raised and handled
- Be able to simulate raising and handling exceptions (see homework)
- Objects
- virtual and non-virtual methods
- abstract classes
- multiple inheritance: what are the potential problems? How are the problems solved in different languages?
- Object implementation: virtual method table. Object implementation in C++ including multiple-inheritance
- Differences between Java object system and C++ object system. Examples: no MI in Java; objects always accessed through references, etc.
- Python
- Sequence types and slices
- Be able to simulate evaluations of slice expressions
- The dictionary built-in type and its use
- Syntax for basic control constructs
- Libraries: importing libraries and naming values imported from libraries
- Data abstraction
- The general notion of "interface". Distinguish the general notion from the specific
use in of the term in Java.
- Relationship between abstract data types and objects
- ML structures -- know how they differ fundamentally from C structs.
- Polymorphic data abstraction: C++ templates, ML functors. Know that the term "functor" used to refer to "function objects" and ML functors are fundamentally different ideas.
- Java
- understand the basic differences between Java's programming model and C++'s.
- Java virtual machine
- Garbage collection
- Terms: reference counting, mark-and-sweep, copying collection, incremental collection, conservative collection
- Be able to simulate reference counting, mark-and-sweep, and copying collection behavior on simple code examples
- Concurrency
- Be able to simulate all possible interleavings of simple code sequences so as
to illustrate the different behaviors that can occur.
- Understand how locks work and be able to simulate execution of code using locks
- Understand how monitors work and how monitors are related to locks; be able to
simulate execution of code using monitors
- Know the kinds approaches that are used to create threads in different languages and
how the choice is affected by the rest of the language design: i.e., in C you pass a function
pointer and argument pointer, in ML you pass a function closure, and in Java you create
an object.
|