Warmup (30m)

We'll start with small groups. Take one problem and, with a partner, talk it through. Use the recipe.

1. Discuss the problem. Develop a data definition that handles the data discussed in the problem.

2. Write a contract, identifying the type of data being consumed by the function you are writing and the type of data it will evaluate to.

3. Write a purpose, which will state, in simple language, what the function needs to do.

4. Write a dummy header. This is just enough of the function definition to allow you to write tests. Remember: the dummy function, though it might do nothing, must still obey the contract.

5. Write tests using check-expect. They should all fail.

6. Write the body of the function. Follow the template for arbitrarily large data. That means we write our cond statement so that it follows the data in the data definition. First question: Is the list empty? Otherwise, we deal with the first and the rest. What do we do with the rest? We probably continue processing it.

Now, all your tests should pass.

Be prepared to walk the class through this process.

Creative Commons License This work is licensed under a Creative Commons BY-SA 3.0 License.