Skip to content

Instantly share code, notes, and snippets.

@hamada-lemois
Created July 27, 2015 15:10
Show Gist options
  • Select an option

  • Save hamada-lemois/f1951960722899914dce to your computer and use it in GitHub Desktop.

Select an option

Save hamada-lemois/f1951960722899914dce to your computer and use it in GitHub Desktop.
リストの内容の和を返す関数
(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