2009-11-01から1日間の記事一覧

計算機プログラムの構造と解釈 第二版 P89 問題2.60

そんなに難しい問題ではない。 重複を考えないぶん、簡単だ。 実装 #!/usr/local/bin/gosh ;; -*- coding: utf-8 -*- (use ggc.debug.trace) (use math.mt-random) (define nil '()) (define (element-of-set? x set) (cond ((null? set) #f) ((equal? x (ca…

計算機プログラムの構造と解釈 第二版 P89 問題2.59

そんなに難しい問題ではない。 基本的な考え方は、今までやってきたappendとかと大してかわらない。 重複がなければリストに付け加えていけば良いだけ。 実装 #!/usr/local/bin/gosh ;; -*- coding: utf-8 -*- (use ggc.debug.trace) (use math.mt-random) (…