[racket] idiomatic way to take elements from a thunk?

From: John Clements (clements at brinckerhoff.org)
Date: Wed Sep 19 23:57:59 EDT 2012

WARNING: TOTALLY UNIMPORTANT QUESTION AHEAD.

I want to enumerate the first 10 values returned by a thunk. I came up with 

(define thunk (lambda () 14))

(for/list ([i 10][e (in-producer thunk #f)]) e)

… but I feel like there must be some way to simply write (stream-take thunk 10). Am I missing something obvious?


John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4800 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20120919/705fc628/attachment.p7s>

Posted on the users mailing list.