Skip to content

Instantly share code, notes, and snippets.

@RyanGlScott
Created September 3, 2016 16:26
Show Gist options
  • Save RyanGlScott/15093718ac50415a02dd34c8adb2cfb9 to your computer and use it in GitHub Desktop.
Save RyanGlScott/15093718ac50415a02dd34c8adb2cfb9 to your computer and use it in GitHub Desktop.
(define (map3 f ls)
(cond [(null? ls)
(values '() '() '())]
[else
(let-values ([(x1 x2 x3) (f (car ls))]
[(ls1 ls2 ls3) (map3 f (cdr ls))])
(values (cons x1 ls1) (cons x2 ls2) (cons x3 ls3)))]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment