Create lists from lists

I want to write function which for n arguments will create n lists and each contains n-th element for every argument, for example:

(aux '(1 2) '(3 4)) = `((1 3) (2 4))

I wrote such function

(define (aux . args) (if (null? args) '() (cons (map car args) (aux (map cdr args)))))

but when i try to evalute (aux '(1 2) '(3 4)) REPL does not show any output.
My question is what shoudl i change because i dont see any syntax error in function.

Source: New Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.