[racket] append-map and #lang lazy

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sat Sep 3 12:39:19 EDT 2011

That's correct, you have to force before you append-map. 

As it turns out, we are working on exactly this issue at the moment, and your email was perfectly timed. 

Thanks -- Matthias



On Sep 3, 2011, at 12:14 PM, Daniil wrote:

> Hello, I am trying to use the Lazy Racket for generating infinite lists.
> Here's the code:
> 
> #lang lazy
> (require racket/list)
> (define hamming
>  (list 1
>        (append-map
>         (lambda (x) (list
>                 (* 2 x)
>                 (* 3 x)
>                 (* 5 x))) hamming)))
> 
> (define bla (take 5 (sort hamming <)))
> 
> 
> However, when I evaluate (! bla) I get:
> append: expected argument of type <proper list>; given #<promise>
> 
> If I understand correctly this happens because I mix racket/list and
> lazy? How can I avoid this? Should I use stream-cons?
> 
> Thank you.
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users




Posted on the users mailing list.