CS2322
Laboratory Problem 21
Union and Intersection using Unrestricted Lambdas
In this problem we wish to define new versions of union and intersection which can process an unlimited number of argument sets. This will require using an unrestricted lambda in the definition of these functions. For example, you should be able to write:
(intersection
(make-set 1 2 3 4)
(make-set 1 3 4 5)
(make-set 1 5 6 3 7)) ==> ("set" 1 3)
(union
(make-set 1 2 3 4)
(make-set 1 3 4 5)
(make-set 2 1)) ==> ("set" 1 2 3 4 5)
except perhaps for the order of elements in the results.
Abstract the structure of these two definitions to get a procedure from which union and intersection can both be obtained by passing the procedural abstraction appropriate arguments.
Lab 21 Scheme Code