-1

I need to write a function in Scheme that acts as a zipper - meaning it takes two lists and creates a 'zipper' out of the two lists such that

(zip '(a b c) '(1 2 3)) => ((a 1) (b 2) (c 3))

Furthermore it takes each element in the nth position and pairs them together.

I'm fairly new to Scheme, so any help would be much appreciated! Thanks!

Nelson.b.austin
  • 3,080
  • 6
  • 37
  • 63

1 Answers1

6

From my Standard Prelude: (define (zip . xss) (apply map list xss))

user448810
  • 17,381
  • 4
  • 34
  • 59