[racket] how to use 'lazy' from racket/promise

From: Lewis Brown (lewisbrown at gmail.com)
Date: Tue Apr 9 21:05:38 EDT 2013

Thanks, Danny.

I am trying to understand how to use promises, in particular for lazy programming. I know there are various implementations that solve this more simply: racket/stream and racket/lazy; but I'd like to see how it's done with the more primitive racket/promise library. It appears that the "lazy" form is specifically meant for lazy, infinite lists, but the spec is not clear enough for me to figure out how to use it. I thought a couple examples would make it so.


Lewis Brown
lewisbrown at gmail.com
503-583-2332

On 9 Apr 13, at 4:50 PM, Danny Yoo wrote:

> Are you sure you're not looking for the racket/stream library instead?
> For example:
> 
>    #lang racket
>    (require racket/stream)
>    (define ones (stream-cons 1 ones))



Posted on the users mailing list.