2007-11-26から1日間の記事一覧

SICP 読み (275) 5.3 記憶の割り当てとごみ集め

問題 5.21 の b.を検討。 (define (count-leaves tree) (define (count-iter tree n) (cond ((null? tree) n) ((not (pair? tree)) (+ n 1)) (else (count-iter (cdr tree) (count-iter (car tree) n))))) (count-iter tree 0))これをレジスタ計算機に手翻訳…

SICP 読み (276) 5.3 記憶の割り当てとごみ集め

前の問題、検証不足と言いつつ次の問題に着手。append も append! もさほど時間がかからなかった。週末は脳の疲労が困憊状態だったのでしょうか。特に append! 方面は帰りのバスの中でさくっと出来た。