If you haven't topped module G, submit the zoom painter to Ray on paper.
Diedra Data has the responsibility to maintain several data directed software systems for Microphage, Inc. Each system uses a two key table in a way similar to the payroll system in the homework exercises. For each system she has a table accessed by put and get which stores the procedures. The entry under keys N, T is the procedure for handling function N on argument type T.
One tool that is needed is a means to check how complete the table is. Data's programmers are working to install the entries and she needs a good way to see how far they have progressed. She assigns you this task:
Write a procedure (table-gaps names types). It takes as input a list of function names and a list of argument types. It's output is a list of all the (name type) pairs for which there is no entry in the table. Thus for each name N in names and for each entry T in types, if (get N T) returns false, then (N T) is one entry in the output of table-gaps. If (get N T) returns a non-false value, then (N T) is not an entry in the output.
For example, suppose procedures P1 .. P5 have been defined, and
(put 'height '(doll) P1) (put 'height '(paint-set) P2) (put 'height '(box) P3) (put 'width '(box) P4) (put 'depth '(paint-set) P5)Then Diedra calls
(define size-names '(height width depth)) (define arg-types '((doll) (paint-set) (box))) (table-gaps size-names arg-types)She would expect to see
((width (doll)) (width (paint-set)) (depth (doll)) (depth (box)))showing the (size-name arg-type) pairs for which there is no entry in the table. The pairs may be shown in any order. If the table is complete, the output would be the empty list.
Submit your definition of table-gaps with
subject: [your name] exclaims topperH1
Do not include the table definition code or the command "(load "table.scm")". The automatic
system will load the table definitions for itself (including get, the only one you will need).