I am creating an evaluator for scheme in scheme, and one of the features I want it to have is map. However, all the definitions for map I've found do not allow for multiple lists. For example:
(define (my-map proc lis)
(cond ((null? lis)
'())
((pair? lis)
(cons (proc (car lis))
(my-map proc (cdr lis))))))
This definition of map is 'incomplete' because, for example, you cannot add 2 lists of numbers with it like so (it only allows one list as an argument):
(my-map + '(1 2 3) '(4 5 6))
How do I modify the above map definition to allow an arbitrary number of lists?