最初のページ 戻る 次へ 最後のページ

map2回目(巻き取り段階)

( map square '(2 3) )

(cons (square (car '(2 3)) (map square (cdr '(2 3))) )

(cons (square 2) (map square '(3)) )

xが空リストでない

新しいmapを駆動(map3回目)

(define (map f x)

(cond ((null? x) nil)

(else (cons (f (car x)) (map f (cdr x)))) ))