Skip to content

Instantly share code, notes, and snippets.

@edw
Created November 25, 2018 21:14
Show Gist options
  • Select an option

  • Save edw/8cb326c0490be9b2f03f3472ab833f64 to your computer and use it in GitHub Desktop.

Select an option

Save edw/8cb326c0490be9b2f03f3472ab833f64 to your computer and use it in GitHub Desktop.
A simple MAP implementation
(define (map proc xs)
(let loop ((xs xs) (result '()))
(if (null? xs) (reverse result)
(loop (cdr xs)
(cons (proc (car xs)) result)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment