On Sat, Aug 18, 2012 at 10:51 PM, Asumu Takikawa <[email protected]> wrote: > On 2012-08-18 21:59:28 -0700, Ian Tegebo wrote: >> (take k (in-generator (infinite-generator (yield (random n))))) >> >> where k and n are positive integers, k<n. >> >> Unfortunately, 'in-generator' returns a sequence while 'take' needs a >> list and calling 'sequence->list' results in an error. > > One way to get around this without using the `lazy` language is to use > stream functions. Sequences can be converted to streams, which are > general things that can be `first` and `rest`ed. Thanks for the clarification; I needed both `stream-cons` and `in-producer` examples. Also, your tone regarding the stream API suggests there might be ongoing work and/or other interesting details. If so, could you elaborate?
-- Ian Tegebo ____________________ Racket Users list: http://lists.racket-lang.org/users

