The second assignment is to code a LISP function. To implement this you will only need to use simple functions. Each student has a different function, yours is: You are write a LISP function named COUNT-NILS which will scan a list and count the NIL atoms at the top level. Here are two examples of its use: (count-nils '(a b)) will produce 0 and (count-nils '(a NIL 5 (b c) NIL (NIL NIL))) will produce: 2 In the second example the list (NIL NIL) contains two NILs but they are not at the top level. The third assignment: You are write a LISP function named NIL-TO-X which will accept a list and produce a new list. The new list will have exactly the same shape as the old list but all the NILS, regardless of level, will be changed to X. Here are two examples of its use: (nil-to-x '(NIL a NIL b)) will produce (X a X b) and (nil-to-x '(a NIL NIL (b NIL c) d (NIL (NIL x) NIL))) will produce: (a X X (b X c) d (X (X x) X)) To turn in your work, you should create a text file with 1) your commented code, 2) a function that runs your code on the examples provided in the assignment, and 3) a function named GRADER that gives instructions on how to load and run your functions. Mail your text file to the designated TA when it is complete.
Due Midnight, Thursday, October 10, 2002, 100 points