Re: [racket] Problem Stream with alternating values

2013-05-21 Thread Patrick Sweetman
You are correct in this, Shannon, and you have nicely explained all of the otherwise confusing clues about thunks. I shall revisit these problems from the point of view of view of the course. The section of Dan Grossman's video lectures that deal with Racket are an excellent introduction to the

Re: [racket] Problem Stream with alternating values

2013-05-19 Thread Patrick Sweetman
t; > Jos > >> -Original Message- >> From: users-boun...@racket-lang.org >> [mailto:users-boun...@racket-lang.org] On Behalf Of Patrick Sweetman >> Sent: jueves, 16 de mayo de 2013 14:31 >> To: users@racket-lang.org >> Subject: [racket] Problem Stream w

Re: [racket] Problem Stream with alternating values

2013-05-19 Thread Patrick Sweetman
nd is much more concise:- (define (dan-then-dog) (stream-cons dan (stream-cons dog (dan-then-dog)) )) Thanks, Patrick Sweetman On 19/05/2013 14:06, Robby Findler wrote: > If you were to replace stream-cons with this function: > > (define (not-stream-cons x y) (

[racket] Problem Stream with alternating values

2013-05-18 Thread Patrick Sweetman
of memory (define dan "dan.jpg") (define dog "dog.jpg") (define (dan-then-dog) (define (H1 st0 b0) (cond [(= b0 1) (H1 (stream-cons dan st0) 0)] [else (H1 (stream-cons dog st0) 1)] ) ) (H1 empty-stream 1)) Can somebody please explain