Still new to Scheme, and I'm currently having trouble with the creation of a list of pairs constructed from two separate lists of different lengths.
Here is my current code:
#lang racket
(define letters '(a b c))
(define (create-lst-letters lst)
(map (lambda (x y) (list x y)) letters lst))
Console input:
(create-lst-letters '(1 2 3 4 5 6 7 8))
Current output:
map: all lists must have same size
first list length: 8
other list length: 3
Wanted output:
'((a . 1) (b . 2) (c . 3) (a . 4) (b . 5) (c . 6) (a . 7) (b . 8))
Another intuition would be to get the quotient and remainder of the length of the input list divided by "letters". Make a new list by appending "letters" quotient times, and then concatenating the first remainder number of elements of "letters". With that new list perform a map as above. I don't feel this is good practice nor an elegant solution, but I'm out of other ideas.