摘要: 练习3-69原文代码(define (triples s t u) (cons-stream (list (stream-car s) (stream-car t) (stream-car u)) (interleave... 阅读全文
posted @ 2015-03-29 10:20 nomasp 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 练习3-68原文Exercise 3.68. Louis Reasoner thinks that building a stream of pairs from three parts is unnecessarily complicated. Instead of separa... 阅读全文
posted @ 2015-03-29 10:11 nomasp 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 练习3-67原文Exercise 3.67. Modify the pairs procedure so that (pairs integers integers) will produce the stream of all pairs of integers (i,j) (w... 阅读全文
posted @ 2015-03-29 10:04 nomasp 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 练习3-66原文Exercise 3.66. Examine the stream (pairs integers integers). Can you make any general comments about the order in which the pairs are... 阅读全文
posted @ 2015-03-29 10:01 nomasp 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 练习3-65原文Exercise 3.65. Use the series ln2 = 1- 1/2 + 1/3 - 1/4 + …… to compute three sequences of approximations to the natural logarithm of... 阅读全文
posted @ 2015-03-28 23:58 nomasp 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 练习3-64原文Exercise 3.64. Write a procedure stream-limit that takes as arguments a stream and a number (the tolerance). It should examine the st... 阅读全文
posted @ 2015-03-28 23:52 nomasp 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 练习3-63原文Exercise 3.63. Louis Reasoner asks why the sqrt-stream procedure was not written in the following more straightforward way, without t... 阅读全文
posted @ 2015-03-28 23:28 nomasp 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 练习3-62原文Exercise 3.62. Use the results of exercises 3.60 and 3.61 to define a procedure div-series that divides two power series. Div-series ... 阅读全文
posted @ 2015-03-28 22:59 nomasp 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 练习3-61原文 代码(define (reciprocal-series s) (cons-stream 1 (scale-stream (mul-series (stream-cdr s) ... 阅读全文
posted @ 2015-03-28 22:58 nomasp 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 练习3-60原文Exercise 3.60. With power series represented as streams of coefficients as in exercise 3.59, adding series is implemented by add-stre... 阅读全文
posted @ 2015-03-28 22:52 nomasp 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 练习3-59原文 代码a)(define (integrate-series s) (stream-map * (stream-map / ones integers) s))b)(define sine-series (cons-stream 0 (int... 阅读全文
posted @ 2015-03-28 22:48 nomasp 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 练习3-58原文Exercise 3.58. Give an interpretation of the stream computed by the following procedure:(define (expand num den radix) (cons-str... 阅读全文
posted @ 2015-03-28 22:38 nomasp 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 练习3-57原文Exercise 3.57. How many additions are performed when we compute the nth Fibonacci number using the definition of fibs based on the ad... 阅读全文
posted @ 2015-03-28 22:28 nomasp 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 练习3-56原文Exercise 3.56. A famous problem, first raised by R. Hamming, is to enumerate, in ascending order with no repetitions, all positive in... 阅读全文
posted @ 2015-03-28 22:18 nomasp 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 练习3-55原文Exercise 3.55. Define a procedure partial-sums that takes as argument a stream S and returns the stream whose elements are S0, S0 + S... 阅读全文
posted @ 2015-03-28 22:11 nomasp 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 练习3-54原文Exercise 3.54. Define a procedure mul-streams, analogous to add-streams, that produces the elementwise product of its two input strea... 阅读全文
posted @ 2015-03-28 22:09 nomasp 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 练习3-53原文Exercise 3.53. Without running the program, describe the elements of the stream defined by (define s (cons-stream 1 (add-streams s s)... 阅读全文
posted @ 2015-03-28 22:05 nomasp 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 练习3-52原文Exercise 3.52. Consider the sequence of expressions(define sum 0) (define (accum x) (set! sum (+ x sum)) sum) (define seq (strea... 阅读全文
posted @ 2015-03-28 21:55 nomasp 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 练习3-51原文Exercise 3.51. In order to take a closer look at delayed evaluation, we will use the following procedure, which simply returns its ar... 阅读全文
posted @ 2015-03-28 21:50 nomasp 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 练习3-50原文Exercise 3.50. Complete the following definition, which generalizes stream-map to allow procedures that take multiple arguments, anal... 阅读全文
posted @ 2015-03-28 21:44 nomasp 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 虽说叫做副作用显得不太好听,但在Lisp中副作用还是非常重要的。而相对于所有状态都必须显式地操作和传递额外参数的方式,如果引进赋值和将状态隐藏在局部变量中,那么就可以用更加模块化的方式来构造系统。正如你所知道的,不用任何赋值的程序设计称为函数式程序设计。相反,广泛采用赋值的程序设计称... 阅读全文
posted @ 2015-03-28 10:38 nomasp 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 练习3-45原文Exercise 3.45. Louis Reasoner thinks our bank-account system is unnecessarily complex and error-prone now that deposits and withdrawa... 阅读全文
posted @ 2015-03-26 20:02 nomasp 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 练习3-44原文Exercise 3.44. Consider the problem of transferring an amount from one account to another. Ben Bitdiddle claims that this can be acco... 阅读全文
posted @ 2015-03-26 19:59 nomasp 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 练习3-42原文Exercise 3.42. Ben Bitdiddle suggests that it’s a waste of time to create a new serialized procedure in response to every withdraw an... 阅读全文
posted @ 2015-03-26 19:43 nomasp 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 练习3-41原文Exercise 3.41. Ben Bitdiddle worries that it would be better to implement the bank account as follows (where the commented line has b... 阅读全文
posted @ 2015-03-26 19:32 nomasp 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 改名的过程也是革新的过程。大到”苹果电脑公司“被改名为”苹果公司”,小到大学的校名更迭。甚至个人网名的更换也能印证其成长的岁月。联想收购ThinkPad和摩托罗拉之后都留了原名让粉丝们得到了些许安慰,不过我认为联想的ThinkPad远不如IBM的。至今依旧怀恋我的T30的键盘手感。今... 阅读全文
posted @ 2015-03-26 17:29 nomasp 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 练习3-38原文Exercise 3.38. Suppose that Peter, Paul, and Mary share a joint bank account that initially contains 100. Concurrently, Peter deposi... 阅读全文
posted @ 2015-03-26 14:35 nomasp 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 1-3月已读完书籍: 《环球科学》2014年12月号 《环球科学》2014年11月号 《环球科学》2015年2月号 《硅谷百年史——伟大的科技创新与创业历程(1900-2013)》 《了不起的盖茨比》 《古诗十九首》 《科学松鼠会》2014年4月 《码农增刊Linus与Linux》 ... 阅读全文
posted @ 2015-03-26 13:23 nomasp 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 练习3-33原文Exercise 3.33. Using primitive multiplier, adder, and constant constraints, define a procedure averager that takes three connectors a... 阅读全文
posted @ 2015-03-26 12:50 nomasp 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 练习3-28原文Exercise 3.28. Define an or-gate as a primitive function box. Your or-gate constructor should be similar to and-gate. 代码(define (or-g... 阅读全文
posted @ 2015-03-26 12:46 nomasp 阅读(107) 评论(0) 推荐(0) 编辑