Guidelines for Assignments

Up to 1/2 of your mark on assignments will be based on documentation
and programming style, so it pays to read this section carefully.
Your programs must be readable and understandable as well as correct.

Note: for Prolog, replace "function" with "predicate" in what follows.

Documentation

Preface each function with a header that gives the following information:

the question number

what the function does

how the the function works (for complex functions)

test cases

Programming Style

Put the most important function first. Do not begin your program with a
bunch of utilities.

Indent your programs for clarity; use a consistent style.

Build complex functions from simple ones.

Avoid complex paths of control; do not nest conditionals more than 2 deep.

Use meaningful function and variable names.

When using data structures write appropriate access functions, such as:

(defun left-subtree (tree) (first (rest tree)) )

Sample Lisp Program

#| Question 2.

description: zip : list, list -> listzip takes two lists and returns a single list where the elements
of the two input lists alternate.