nomasp

風立ちぬ、いざ生きめやも」

【SICP练习】152 练习4.8

练习4-8原文Exercise 4.8. “Named let” is a variant of let that has the form (let <var> <bindings> <body>)The and are just as in ordin...

2015-04-01 09:53:00

阅读数 5136

评论数 0

【SICP练习】151 练习4.7

练习4-7原文Exercise 4.7. Let* is similar to let, except that the bindings of the let variables are performed sequentially from left to right, and each b...

2015-04-01 09:09:56

阅读数 4279

评论数 0

【SICP练习】150 练习4.6

练习4-6原文Exercise 4.6. Let expressions are derived expressions, because (let (( ) … ( )) ) is equivalent to ((lambda ( … ) ) ) Implement a sy...

2015-04-01 08:52:20

阅读数 4271

评论数 0

【SICP练习】149 练习4.5

练习4-5原文Exercise 4.5. Scheme allows an additional syntax for cond clauses, ( => ). If evaluates to a true value, then is evaluated. Its value mu...

2015-03-31 17:11:03

阅读数 3183

评论数 0

【SICP练习】148 练习4.4

练习4-4原文Exercise 4.4. Recall the definitions of the special forms and and or from chapter 1: ● and: The expressions are evaluated from left to ri...

2015-03-31 13:19:49

阅读数 2838

评论数 0

【SICP练习】147 练习4.3

练习4-3原文Exercise 4.3. Rewrite eval so that the dispatch is done in data-directed style. Compare this with the datadirected differentiation procedure ...

2015-03-29 19:35:50

阅读数 2277

评论数 0

【SICP练习】146 练习4.2

练习4-2原文Exercise 4.2. Louis Reasoner plans to reorder the cond clauses in eval so that the clause for procedure applications appears before the claus...

2015-03-29 19:31:59

阅读数 2146

评论数 0

【SICP练习】145 练习4.1

练习4-1原文Exercise 4.1. Notice that we cannot tell whether the metacircular evaluator evaluates operands from left to right or from right to left. Its ...

2015-03-29 16:27:24

阅读数 2743

评论数 0

【SICP练习】144 练习3.82

练习3-82原文Exercise 3.82. Redo exercise 3.5 on Monte Carlo integration in terms of streams. The stream version of estimate-integral will not have an ar...

2015-03-29 15:38:54

阅读数 2761

评论数 0

【SICP练习】143 练习3.81

练习3-81原文“random” numbers. Produce a stream formulation of this same generator that operates on an input stream of requests to generate a new random n...

2015-03-29 15:31:56

阅读数 2373

评论数 0

【SICP练习】142 练习3.77

练习3-77原文Exercise 3.77. The integral procedure used above was analogous to the “implicit” definition of the infinite stream of integers in section 3....

2015-03-29 11:45:29

阅读数 1625

评论数 0

【SICP练习】141 练习3.72

练习3-72原文Exercise 3.72. In a similar way to exercise 3.71 generate a stream of all numbers that can be written as the sum of two squares in three dif...

2015-03-29 11:15:42

阅读数 1886

评论数 0

【SICP练习】140 练习3.71

练习3-71原文代码(define (Ramanujan s) (define (stream-cadr s) (stream-car (stream-cdr s))) (define (stream-cddr s) (stream-cdr (stream-cd...

2015-03-29 11:10:17

阅读数 2797

评论数 0

【SICP练习】139 练习3.70

练习3-70原文代码(define (merge-weighted s1 s2 weight) (cond ((stream-null? s1) s2) ((stream-null? s2) s1) (else (let ((cars1 (stream-car s1)...

2015-03-29 10:41:16

阅读数 1713

评论数 0

【SICP练习】138 练习3.69

练习3-69原文代码 (define (triples s t u) (cons-stream (list (stream-car s) (stream-car t) (stream-car u)) (interleave ...

2015-03-29 10:20:34

阅读数 2081

评论数 0

【SICP练习】137 练习3.68

练习3-68原文Exercise 3.68. Louis Reasoner thinks that building a stream of pairs from three parts is unnecessarily complicated. Instead of separating th...

2015-03-29 10:11:25

阅读数 2316

评论数 0

【SICP练习】136 练习3.67

练习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) (without ...

2015-03-29 10:04:31

阅读数 2509

评论数 0

【SICP练习】135 练习3.66

练习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 placed...

2015-03-29 10:01:50

阅读数 3155

评论数 0

【SICP练习】134 练习3.65

练习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 2, i...

2015-03-28 23:58:17

阅读数 1778

评论数 0

【SICP练习】133 练习3.64

练习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 stream un...

2015-03-28 23:52:36

阅读数 1566

评论数 0

提示
确定要删除当前文章?
取消 删除