exam01 will be 2022-Oct-20 (Thu) in-class, on-paper, closed-notes.
The following topics may be on the exam:
- Anything on hw01–hw05
- The design recipe (incl. union types and product(compound) types):
- built-in types (not much to say here)
- union-types (incl. the template for it)
in racket, but not in Java (yet)
- structs (a.k.a.
compound types
or product types
) (incl. template)
- combos: union-of-union, struct-of-struct, and struct-of-unions (defer to helpers appropriately);
- union-of-structs and its template
- union-of-structs with a self-reference in the data def'n (add natural-recursive call, to template)
Note: Lists are merely an example of this category,
as are
natural numbers
and
the nonsense-example glarps-and-blahs
- Applying the design recipe:
Given a description of what we want to represent,
come up with suitable unions/structs as needed,
and be able to write functions processing them.
E.g. be able to work through an example similar to, albeit more sensible than,
glarps-and-blahs.
- Standard vocabulary
(e.g.
parameter
vs. argument
vs. local variable
;
expression
vs. statement
;
statically typed
vs. dynamic typing
vs. untyped
;
compiled
vs. interpreted
)
- programming language paradigms — low-level, procedural, O.O., functional, declarative.
Be able to give the primary features of each family/paradigm, and give a notable language associated with that paradigm.
- Trade-offs of mutable vs. immutable data
- Scope and shadowing:
If this is on the exam, it won't be heavily emphasized.
a
binding occurrence
vs. a bound occurrence
;
racket's let and let*.
- Higher-order functions.
If this is on the exam, it won't be heavily emphasized.
- You should be able to read and understand code that
passes a function as an argument
(either a named function, or an anonymous lambda/λ expression),
as well as code which receives a function as an argument.
- You should be able to write the signature for a such a function
(possibly as a parameterized signature, even though racket's contracts aren't parameterized).
- You will not need to know
how to write a function which returns a (newly-created) function.
You will not need to know for exam01:
Sample exam
Here is a practice exam (D2L) (incl. solution).
Note that it does not necessarily cover all of the above topics
(and, covers grammars, which we haven't yet covered).
I suggest you sit and take the practice exam directly,
writing down all answers (not just thinking about them in your head),
before looking at the solution.