The gen:stream documentation has this example:
(define-struct list-stream (v) #:methods gen:stream [(define (stream-empty? stream) (empty? (list-stream-v stream))) (define (stream-first stream) (first (list-stream-v stream))) (define (stream-rest stream) (rest (list-stream-v stream)))]) I believe this example is broken in a sneaky way; the “stream-rest” operation returns a simple list rather than a list-stream. This happens to “work” wrt things like stream-rest and stream-first because lists are also streams. I claim that this should instead read: (define-struct list-stream (v) #:methods gen:stream [(define (stream-empty? stream) (empty? (list-stream-v stream))) (define (stream-first stream) (first (list-stream-v stream))) (define (stream-rest stream) (list-stream (rest (list-stream-v stream))))]) Can someone confirm that this is just a typo? John -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/707f6164-d28e-4191-bf13-313edac3d5f0%40mtasv.net.