source-academy / sicp

XML sources of SICP and SICP JS, and support for generating Interactive SICP JS, PDF, e-book and comparison editions

Home Page:https://sourceacademy.org/sicpjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem in 3.5.1

clean99 opened this issue · comments

Screenshot 2022-11-14 at 2 44 18 PM

I think here the stream_filter will return

pair(head(stream), 
     () => stream_filter(pred, stream_tail(stream)));

instead of

pair(head(stream), 
     stream_filter(pred, stream_tail(stream)));

If it calls stream_filter directly in the tail, it will become an ordinary list?

Yes, you are right! Thanks for this keen observation! Will fix this in the next printing, and in the online edition.