2016-07-01から1ヶ月間の記事一覧

SICPゼミ第20回

練習問題3.27

SICPゼミ第19回

練習問題3.24 (define (make-table same-key?) (let ((table (list '*table*))) (define (lookup key) (let ((record (assoc key (cdr table)))) (if record (cdr record) #f))) (define (assoc key records) (cond ((null? records) #f) ((same-key? key (c…

SICPゼミ第18回

練習問題3.21 (define (print-queue queue) (display (car queue))) Benはqueueの末尾のポインタを見てはっちゃけてるだけ。 by pine 練習問題3.22 (define (make-queue) (let ( (front-ptr '()) (rear-ptr '()) ) (define (empty-queue?) (null? front-ptr)…

SICPゼミ第17回

練習問題3.12 1つめの (cdr x) は (b) 2つめの (cdr x) は (b c d)1つめでは x が (a b) なので (b) が返る。 2つめでは x が append! にある set-cdr! のせいで (a b c d) になっているので (b c d) が返る。by tube 練習問題3.13 a -> b -> c -> a ->.....…