SCHEME/Racket/R5RS
Attempting to make a recursive procedure that pairs 2 lists of the same size. Just cant get the recursive call right. This is what I have and I am stuck.
(define (pairs list1 list2)
(if (or (null? list1) (null? list2))
'()
(cons (car list1) (car list2))
))
Test Case: (pairs '(1 2 3) '(a b c)) Desired Output: ((1 . a) (2 . b) (3 . c)) Current Output: (1 . a)