[racket] append-map and #lang lazy

From: Daniil (eraserfingers at gmail.com)
Date: Sat Sep 3 12:14:38 EDT 2011

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.


Posted on the users mailing list.