[racket] Making a Racket function "recallable"

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Wed Feb 15 12:19:40 EST 2012

On Wed, Feb 15, 2012 at 3:10 AM, Joe Gilray <jgilray at gmail.com> wrote:
> The code that Danny wrote to create fib-stream works great with his
> peek-fibs function, but I really don't understand stream-first.
>
> I wrote:
>
> ; function to use the fib-stream to generate a list of all fibs < n
> (define (fib-stream-less-than-n n)
>   (let ([fib-val (stream-first fib-stream)])
>     (if (>= fib-val n) '() (cons fib-val (fib-less-than-n n)))))
                                                   ^^^^^^^^^^^^^^^^

Are you sure you mean to use fib-less-than-n here?


Posted on the users mailing list.