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

SICPゼミ第10回

練習問題2.53 gosh> (list 'a 'b 'c) (a b c) gosh> (list (list 'george )) ((george)) gosh> (cdr '((x1 x2) (y1 y2))) ((y1 y2)) gosh> (cadr '((x1 x2) (y1 y2))) (y1 y2) gosh> (pair? (car '(a short list ))) #f gosh> (memq 'red '((red shoes) (blu…

SICPゼミ第9回

練習問題2.43 (queen-cols (- k 1)) をk回呼び出しているのでごみ。 注意 これから先の範囲は図形言語を前提としているので、tube は Racket で、ほか三人は Gauche でがんばって図形言語を入れました。

SICPゼミ第8回

練習問題2.33 (define nil '()) (define (accumulate op initial sequence) (if (null? sequence) initial (op (car sequence) (accumulate op initial (cdr sequence ))))) (define (map p sequence) (accumulate (lambda (x y) (cons (p x) y)) nil sequen…

SICPゼミ第7回

練習問題2.24 練習問題2.25 (car (cdr (car (cdr (cdr (list 1 3 (list 5 7) 9)))))) (car (car (list (list 7)))) (car (cdr (car (cdr (car (cdr (car (cdr (car (cdr (car (cdr (list 1 (list 2 (list 3 (list 4 (list 5 (list 6 7)))))))))))))))))) by …

SCIPゼミ第6回

練習問題2.12 (define (make-center-percent c p) (define w (* c (/ p 100))) (make-interval (- c w) (+ c w))) by どりきゃす