-
-14. Define a "dup" function that duplicates its argument to form a pair
-whose elements are the same.
-Expected behavior:
- ((dup 10) get-first) ; evaluates to 10
- ((dup 10) get-second) ; evaluates to 10
-15. Define a "sixteen" function that makes
-sixteen copies of its argument (and stores them in a data structure of
-your choice).
-
-16. Inspired by our definition of ordered pairs, propose a data structure capable of representin\
-g ordered tripes. That is,
- (((make-triple M) N) P)
-should return an object that behaves in a reasonable way to serve as a triple. In addition to de\
-fining the make-triple function, you have to show how to extraxt elements of your triple. Write \
-a get-first-of-triple function, that does for triples what get-first does for pairs. Also write \
-get-second-of-triple and get-third-of-triple functions.
-
-> I expect some to come back with the lovely
-> (\f. f first second third)
-> and others, schooled in a certain mathematical perversion, to come back
-> with:
-> (\f. f first (\g. g second third))
-
-
-17. Write a function second-plus-third that when given to your triple, returns the result of add\
-ing the second and third members of the triple.
-
-You can help yourself to the following definition:
- (define add (lambda (x) (lambda (y) (+ x y))))
+<!-- unmap2 (g, xs) where g x \mapsto (y,z), and unmap2 (g, [x1, x2, x3]) \mapsto ([y1, y2, y3], [z1, z2, z3]) -->