【SICP练习】120 练习3.51

来源:互联网 发布:雷达图制作软件 编辑:程序博客网 时间:2024/05/02 00:10

练习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 argument after printing it:

(define (show x)    (display-line x)    x)

What does the interpreter print in response to evaluating each expression in the following sequence?

(define x (stream-map show (stream-enumerate-interval 0 10))) (stream-ref x 5) (stream-ref x 7)

代码

(define (show x)  (display-line x)  x)(define x (stream-map show (stream-enumerate-interval 0 10)))0;Value: x(stream-ref x 5)12345;Value: 5(stream-ref x 7)67;Value: 7



感谢访问,希望对您有所帮助。 欢迎关注或收藏、评论或点赞。


为使本文得到斧正和提问,转载请注明出处:
http://blog.csdn.net/nomasp


5 0
原创粉丝点击