Structure and Interpretation of Computer Programs by Harold Abelson & Gerald Jay Sussman & Julie Sussman
Author:Harold Abelson & Gerald Jay Sussman & Julie Sussman
Language: eng
Format: epub
ISBN: 0-262-01153-0
Publisher: MIT Press
(define x (stream-map show (stream-enumerate-interval 0 10)))
(stream-ref x 5)
(stream-ref x 7)
Exercise 3.52. Consider the sequence of expressions
(define sum 0)
(define (accum x)
(set! sum (+ x sum))
sum)
(define seq (stream-map accum (stream-enumerate-interval 1 20)))
(define y (stream-filter even? seq))
(define z (stream-filter (lambda (x) (= (remainder x 5) 0))
seq))
(stream-ref y 7)
(display-stream z)
What is the value of sum after each of the above expressions is evaluated? What is the printed response to evaluating the stream-ref and display-stream expressions? Would these responses differ if we had implemented (delay <exp>) simply as (lambda () <exp>) without using the optimization provided by memo-proc ? Explain.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8301)
Test-Driven Development with Java by Alan Mellor(6728)
Data Augmentation with Python by Duc Haba(6641)
Principles of Data Fabric by Sonia Mezzetta(6392)
Learn Blender Simulations the Right Way by Stephen Pearson(6292)
Microservices with Spring Boot 3 and Spring Cloud by Magnus Larsson(6165)
Hadoop in Practice by Alex Holmes(5958)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5807)
RPA Solution Architect's Handbook by Sachin Sahgal(5561)
Big Data Analysis with Python by Ivan Marin(5367)
The Infinite Retina by Robert Scoble Irena Cronin(5252)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5147)
Pretrain Vision and Large Language Models in Python by Emily Webber(4330)
Infrastructure as Code for Beginners by Russ McKendrick(4091)
Functional Programming in JavaScript by Mantyla Dan(4038)
The Age of Surveillance Capitalism by Shoshana Zuboff(3955)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3805)
Embracing Microservices Design by Ovais Mehboob Ahmed Khan Nabil Siddiqui and Timothy Oleson(3609)
Applied Machine Learning for Healthcare and Life Sciences Using AWS by Ujjwal Ratan(3580)
