練習
http://www.kt.rim.or.jp/~kbk/zakkicho/07/zakkicho0705.html#D20070528-4
書いてみた.
(use srfi-1) (define (nth ls n) (if (= n 1) (car ls) (nth (cdr ls) (- n 1)))) (nth (iota 100 80) 11) (nth '(3 4 5 9 1 2) 5) (define (nth-1 ls n) (nth ls (- n 1))) (nth-1 (iota 100 80) 11) (nth-1 '(3 4 5 9 1 2) 5)
これぐらいならさくっと書けるけど,下にあるreduce(l or r)を実装汁!というのは解けない.