练习3-68原文Exercise 3.68. Louis Reasoner thinks that building a stream of pairs from three parts is unnecessarily complicated. Instead of separating the pair (S0,T0) from the rest of the pairs in the fir...
分类:
其他好文 时间:
2015-03-29 10:52:16
阅读次数:
136
练习3-69原文代码
(define (triples s t u)
(cons-stream (list
(stream-car s)
(stream-car t)
(stream-car u))
(interleave
(stream-map (lambda (x) (cons (stream-car s)...
分类:
其他好文 时间:
2015-03-29 10:50:16
阅读次数:
118
练习3-70原文代码(define (merge-weighted s1 s2 weight)
(cond ((stream-null? s1) s2)
((stream-null? s2) s1)
(else
(let ((cars1 (stream-car s1))
(cars2 (stream-car s2)))
(cond (...
分类:
其他好文 时间:
2015-03-29 10:50:12
阅读次数:
132
练习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 until it finds two successive elements that differ in...
分类:
其他好文 时间:
2015-03-29 09:31:45
阅读次数:
133
说到流,就涉及到一个*nix的概念:管道——在*nix中,流在Shell中被实现为可以通过 |(管道符) 进行桥接的数据,一个进程的输出(stdout)可被直接作为下一个进程的输入(stdin)。 在Node中,流(Stream)的概念与之类似,代表一种数据流可供桥接的能力。
分类:
Web程序 时间:
2015-03-29 01:52:05
阅读次数:
176
练习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)))分析s是一串2的幂。也就是1、2、4、8、16、32……...
分类:
其他好文 时间:
2015-03-28 23:19:56
阅读次数:
396
练习3-59原文
代码a)(define (integrate-series s)
(stream-map * (stream-map / ones integers) s))b)(define sine-series (cons-stream 0 (integrate-series cosine-series)))
(define cosine-series (con...
分类:
其他好文 时间:
2015-03-28 23:19:21
阅读次数:
387
练习3-61原文
代码(define (reciprocal-series s)
(cons-stream 1 (scale-stream (mul-series (stream-cdr s)
(reciprocal-series s))...
分类:
其他好文 时间:
2015-03-28 23:17:09
阅读次数:
155
区别一套是input/output stream 体系,一套是reader/writer体系,两者的区别是stream负责的是字节流的数据,reader/writer负责的是字符流。设计模式decorator模式该模式主要用于在不改变已有的component设计和代码的情况下,不断的增加附属功能。打个比喻,就像你有一副画,为它配一个或者多个不同的画框。具体可以参考这里:http://www.cnb...
分类:
编程语言 时间:
2015-03-28 21:52:00
阅读次数:
224
做个标记http://coolshell.cn/articles/9104.htmlsed全名叫stream editor,流编辑器,用程序的方式来编辑文本,相当的hacker啊。sed基本上就是玩正则模式匹配,所以,玩sed的人,正则表达式一般都比较强。同样,本篇文章不会说sed的全部东西,你可以...
分类:
其他好文 时间:
2015-03-28 10:03:36
阅读次数:
170