プログラミング再入門

プログラミングをもう一度ちゃんと勉強する読書ノート

2013-10-01から1ヶ月間の記事一覧

SICP 3.5.4 Streams and Delayed Evaluation

ノート ストリームと遅延評価。 The interpreter's ability to deal with such an implicit definition depends on the delay that is incorporated into cons-stream. implicitだと行っているのはintとしては明示的に再帰的な定義になっているが、評価され…

SICP 3.5.3 Exploiting the Stream Paradigm

ノート 「exploit」は英和辞典には「不当利用」的な意味が乗っているが、英英辞典では「最大限に利用する」と言う意味。 Moreover, they avoid some of the theoretical tangles that accompany the introduction of assignment into a programming language…

SICP 3.5.2 Infinite Streams

ノート 必要になった部分の値をその時に生成する手法で無限リストが作れる。 以下の実装で #lang racket (define-syntax cons-stream (syntax-rules () ((cons-stream a b) (cons a (memo-proc (lambda () b)))))) (define stream-null? null?) (define the-…

SICP 3.5 Streams

SICPは計算機科学の最初に習うコースとの事ですが、最初から遅延評価を習う事に驚き。 ノート 状態をモデリングするもう一つの方法としてのストリーム。ストリームの方が複雑さをやや緩和出来る。 時々刻々と変化する実世界の状態を、状態変数とその値を変化…