Question: Define a pure, recursive function zip that takes two arguments, each of which is a list, and produces a list of pairs, where the

Define a pure, recursive function zip that takes two arguments, each of which is a list, and produces a list of pairs, where the nth pair's car is the nth element of xs and the nth pair's cdr is the nth element of ys. The behavior of zip is undefined if either xs or ys is not a list or if xs and ys are both lists but do not have the same length. Examples: (zip (123) '(a b c)) => ((1. a) (2. b) (3. c))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
