Created
April 24, 2017 13:56
-
-
Save shirok/d3da9e29b0a5cd847c9be61e87bf79cf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| gosh> (define (foo ls) | |
| (if (null? ls) | |
| '(0) | |
| (map + ls (append (foo (cdr ls)) '(0))))) | |
| foo | |
| gosh> (foo '(1 2 3)) | |
| (6 5 3) | |
| ;; 1 2 3 | |
| ;; 2 3 0 | |
| ;; + 3 0 0 | |
| ;; ------ | |
| ;; 6 5 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment