only lisp
文章平均质量分 78
草帽当家的
这个作者很懒,什么都没留下…
展开
-
SICP Section 2.1.4
Exercise 2.7#lang racket(define (make-interval a b) (cons a b))(define (upper-bound interval) (cdr interval))(define (lower-bound interval) (car interval))Exercise 2.8#lang racket(define原创 2013-04-09 22:59:36 · 509 阅读 · 0 评论 -
SICP Section 2.1.3
Exercise 2.4#lang racket(define (cons x y) (lambda (m) (m x y)))(define (car z) (z (lambda (p q) p)));(cons x y) return a procedure (lambda (m) (m x y));that takes a procedure m as argument原创 2013-04-08 22:31:31 · 620 阅读 · 0 评论 -
SICP Sections 2.1.1-2.1.2
Exercise 2.1#lang racket;the greatest common divisor of the two integers(define (gcd a b) (if (= b 0) a (gcd b (remainder a b))));reduce the numerator and the denominator to the low原创 2013-04-08 00:35:15 · 524 阅读 · 0 评论 -
SICP Section 2.2.1
Exercise 2.17#lang racket(define (last-pair l) (if (null? (cdr l)) l (last-pair (cdr l))))Exercise 2.18#lang racket; (define (reverse list); (define (mid-reverse list midl原创 2013-04-10 21:28:55 · 524 阅读 · 0 评论