练习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 clause for assignments. He argues that this will make the...
分类:
其他好文 时间:
2015-03-30 09:35:28
阅读次数:
138
练习4-3原文Exercise 4.3. Rewrite eval so that the dispatch is done in data-directed style. Compare this with the datadirected differentiation procedure of exercise 2.73. (You may use the car of a compound...
分类:
其他好文 时间:
2015-03-30 09:33:38
阅读次数:
167
练习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 evaluation order is inherited from the underlying Li...
分类:
其他好文 时间:
2015-03-29 18:08:21
阅读次数:
136
练习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 argument telling how many trials to perform. Instead,...
分类:
其他好文 时间:
2015-03-29 16:37:17
阅读次数:
162
练习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 number or to reset the sequence to a specified value...
分类:
其他好文 时间:
2015-03-29 16:37:04
阅读次数:
151
#lang racket(define (cont-frac N D k) (define (cf t) (if (= t 1) (/ (N t) (D t)) (/ (N t) (+ (D t) (cf (- t 1)))) );if );cf (cf k) )...
分类:
其他好文 时间:
2015-03-29 15:00:48
阅读次数:
121
练习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.5.2. Alternatively, we can give a definition of inte...
分类:
其他好文 时间:
2015-03-29 13:45:57
阅读次数:
101
练习3-71原文代码(define (Ramanujan s)
(define (stream-cadr s) (stream-car (stream-cdr s)))
(define (stream-cddr s) (stream-cdr (stream-cdr s)))
(let ((scar (stream-car s))...
分类:
其他好文 时间:
2015-03-29 12:21:38
阅读次数:
122
练习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 different ways (showing how they can be so written). 代码...
分类:
其他好文 时间:
2015-03-29 12:17:48
阅读次数:
147
练习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 into the stream? For example, about how many pairs...
分类:
其他好文 时间:
2015-03-29 10:55:03
阅读次数:
110