Created
July 27, 2015 15:10
-
-
Save hamada-lemois/f1951960722899914dce 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
| (defun sum-of-list (list) | |
| (defun it (list sum) | |
| (if (/= 0 (length list)) | |
| (it (rest list) (+ sum (first list))) | |
| sum)) | |
| (it list 0)) | |
| (sum-of-list '(1 2 3 4 5 6 7 8 9)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment