Created
September 27, 2016 20:29
-
-
Save QuantumFractal/883d830c08b0a5d7289be744d5b907af to your computer and use it in GitHub Desktop.
null created by QuantumFractal - https://repl.it/DiiB/3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define sum | |
(lambda (lst) | |
(if (null? lst) | |
0 | |
(+ (car lst) (sum (cdr lst))) | |
) | |
) | |
) | |
(define map | |
(lambda (f lst) | |
(if (null? lst) | |
'() | |
(cons (f (car lst)) (map f (cdr lst))) | |
) | |
) | |
) | |
(define a_list (list 1 2 3 4)) | |
(define addone (lambda (x) (+ x 1))) | |
(sum (map addone a_list)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment