CS 1410-20 Lab 3

If you’re struggling with HW 3:

  1. Define list-of-sym (for a list of symbols) and its generic template.
  2. Implement count-syms, which counts the number of symbols in a list-of-sym.
  3. Implement got-milk?, which determines whether a list-of-sym includes 'milk.
  4. Implement go-bad, which replaces every 'milk in a list-of-sym with 'yogurt.

If you’re ready to move on:

  1. Implement gen-milks, which takes a natural number n and produces a list with n 'milks.
  2. Implement each-bigger? which takes two lists of numbers, where the two lists have the same length. The result should be true if each element of the first list is bigger than the corresponding element of the second list. For example (each-bigger? (list 1 5 3) (list 0 3 2)) should produce true, while (each-bigger? (list 1 5 3) (list 0 6 2)) should produce false.
  3. Implement all-bigger? which takes two lists of numbers. The result should be true if each element of the first list is bigger than every number in the second list. For example (all-bigger? (list 1 5 3) (list 0 3 2)) should produce false, while (all-bigger? (list 2 5 3) (list 0 1)) should produce true.

Last update: Wednesday, October 20th, 2010
mflatt@cs.utah.edu