simply scheme 第五章 练习
2010-07-04 13:38
253 查看
5.1 (1)(I me mine) (2)(is empty) (3) 1234 (4) (23 45) (5) "" (6) () (7) 6 (8) ("" "") (9) 2
5.2
(define (f1 wd1 wd2)
(sentence (bf wd1) (bf wd2)))
(define (f2 wd1 wd2)
(sentence (bf wd1) (bl wd2) (word (first wd1) (last wd2))))
(define (f3 wd1 wd2)
(se wd1 wd1))
(define (f4 wd1 wd2)
(word (first (butfirst wd1)) (first (butfirst wd2))))
5.3 output: m and mezzanine
5.4 output: 4 and square
5.5 output: abc and (a b c)
5.6 输出一样
5.7 output: "" and ()
5.8 none
5.9 (matt wright) (brian harvey)
5.10 word returns word sentence returns sentence
5.11 the same as 5.10
5.12
5.13 'banana quote
5.14 (define (third x)
(first(butfirst(butfirst x))))
5.15 (define (first-two x)
(word (first x)(first (butfirst x))))
5.16 (define (two-first x y)
(word (first x)(first y)))
(define (two-first-sent x)
(word (first(first x))(first(first(butfirst x)))))
5.17 (define (knight x)
(se 'Sir x))
5.18 error
5.19 (define (insert-and x)
(se (butlast x) 'and (last x)))
5.20 (define (middle-names x)
(butlast(butfirst x)))
5.21
(define (query x)
(se (first (butfirst x)) (first x) (butfirst(butfirst x)) '?))
5.2
(define (f1 wd1 wd2)
(sentence (bf wd1) (bf wd2)))
(define (f2 wd1 wd2)
(sentence (bf wd1) (bl wd2) (word (first wd1) (last wd2))))
(define (f3 wd1 wd2)
(se wd1 wd1))
(define (f4 wd1 wd2)
(word (first (butfirst wd1)) (first (butfirst wd2))))
5.3 output: m and mezzanine
5.4 output: 4 and square
5.5 output: abc and (a b c)
5.6 输出一样
5.7 output: "" and ()
5.8 none
5.9 (matt wright) (brian harvey)
5.10 word returns word sentence returns sentence
5.11 the same as 5.10
5.12
5.13 'banana quote
5.14 (define (third x)
(first(butfirst(butfirst x))))
5.15 (define (first-two x)
(word (first x)(first (butfirst x))))
5.16 (define (two-first x y)
(word (first x)(first y)))
(define (two-first-sent x)
(word (first(first x))(first(first(butfirst x)))))
5.17 (define (knight x)
(se 'Sir x))
5.18 error
5.19 (define (insert-and x)
(se (butlast x) 'and (last x)))
5.20 (define (middle-names x)
(butlast(butfirst x)))
5.21
(define (query x)
(se (first (butfirst x)) (first x) (butfirst(butfirst x)) '?))
相关文章推荐
- simply scheme 第十三章 练习
- simply scheme 第十五章 练习
- 《Python核心编程》第二版第97页第五章练习 续四
- 最后一本书 第五章上机练习1-4
- 【慕课笔记】第五章 阶段练习 第3节 使用Eclipse调试程序
- Java入门 第一季第五章 编程练习解析
- 《Android编程权威指南》第二版 第五章 挑战练习
- C Primer Plus (第五版) 第五章 编程练习
- 《python核心编程第二版》第五章练习解析
- 第五章 5.2节练习 & 5.3.1节练习
- SQL 第五章 -- 小型练习项目
- C Primer Plus 第五章 编程练习 1-8题
- C++ PRIMER第五章课后练习
- 《Python核心编程》第二版第97页第五章练习 -Python核心编程答案-自己做的-
- 《Python核心编程》第二版第97页第五章练习 续一 -Python核心编程答案-自己做的-
- 《Python核心编程》第二版第97页第五章练习 续五
- 算法与数据结构第五章树上机练习
- 现代软件工程 第五章 【团队和流程】练习与讨论
- C++ primer plus(sixth edition) 编程练习答案(answers for programing exercises)第五章(chapter 5) 1-5
- 《JQuery基础教程》第四版课后练习代码--第五章