# MATH show map function for applying a function across the elements of a list
[hear] (define map /
         lambda (p lst)
          (if (> (list-length / lst) 0)
            (prepend
              (p (head / lst))
              (map (p) (tail / lst)))
            (vector)));

[hear] (list= (map (? x / * (x) 2) (vector 0 8 15))
               (vector 0 16 30));

[hear] (list= (map (? x / * (x) 2) (vector 12 4 0 9))
               (vector 24 8 0 18));

[hear] (list= (map (? x / * (x) 2) (vector 8 9 5 7 10))
               (vector 16 18 10 14 20));

[hear] (list= (map (? x / * (x) 2) (vector 10 12 19 8 3 1))
               (vector 20 24 38 16 6 2));

[hear] (list= (map (? x 42) (vector 5 18 4))
               (vector 42 42 42));

[hear] (list= (map (? x 42) (vector 3 10 17 11))
               (vector 42 42 42 42));

[hear] (list= (map (? x 42) (vector 5 13 6 16 2))
               (vector 42 42 42 42 42));

[hear] (list= (map (? x 42) (vector 9 1 19 14 6 10))
               (vector 42 42 42 42 42 42));

[hear] (define crunch /
         lambda (p lst)
          (if (>= (list-length / lst) 2)
            (p (head / lst) (crunch (p) (tail / lst)))
            (if (= (list-length / lst) 1)
              (head /
               lst)
              (undefined))));

[hear] (= (crunch (+) (vector 5 12 2)) 19);

[hear] (= (crunch (+) (vector 11 18 1 4)) 34);

[hear] (= (crunch (+) (vector 15 13 10 12 2)) 52);

[hear] (= (crunch (+) (vector 12 6 17 15 4 10)) 64);