Quiz 1 moved online due to weather concerns. The quiz will be available on VIULearn
from Monday Feb. 3rd at 1pm until Tuesday Feb. 4th at 3pm. You'll have 60 minutes
once you start, open notes, open book, strictly individual effort.
As per the exams page,
the quiz will be closed book, closed notes, no electronics, and held in the lab
during your scheduled lab section. You will have 50 minutes to complete the quiz.
You are permitted one double-sided 8.5x11" page of notes ('cheat sheet').
This first quiz is a mix of theory and applied/lisp coding, focused on the the lab and lecture
material up to and including parameter passing mechanisms and handling of multiple return
values in lisp. (It will not include higher order functions, lambda, etc.)
There will be four questions with an emphasis on the following:
Topic: the implementation and use of lists in lisp (and the implications of the implementation)
- e.g. given the following lisp function and calls to it, explain what the results will be
(both the returned value and any side effects) and how that relates to the way
lists are implemented and passed in lisp
Topic: recursion/tail recursion in theory and/or as applied in lisp
- e.g. rewrite the following code segment to be tail recursive (code segment might be
general recursive or use a loop)
Topic: functional purity in theory and/or as applied in lisp
- e.g. explain the pros/cons of functional purity in general, or in the context of hybrid languages like lisp
- e.g. explain the specific aspects of the following code segment that are/are not functionally pure
- e.g. rewrite the following code segment to be functionally pure (while still providing the
same functionality from the perspective of the caller)
Topic: (manual) runtime type checking in lisp
- e.g. given the following lisp code segment and assuming we cannot trust the caller
to pass valid parameters, add suitable type checking to the code to catch errors
and prevent potential run-time crashes
Note that 'code segments' might be given in lisp or might be given as pseudo-code.