0
(define (accumulate op initial sequence)
(if (null? sequence)
initial
(op (car sequence)
(accumulate op initial (cdr sequence)))))
(define (flatmap proc seq)
(accumulate append nil (map proc seq)))
上記はSchemeのSICPのコードスニペットです。フラットマップ手順が必要なのはなぜですか?フラットマップとマップの違いは何ですか?SICPにおけるフラットマップの意義は何ですか?
「... flatmapが複数生じるかもしれない」オリジナルポスターの利益のために、flatmapはまた、要素に値を生成しないかもしれマッピング戻る場合'()。フラットマップを使用してフィルタを実装できます。 –