[racket] Possible bug in racket/stream

From: Thomas Chust (chust at web.de)
Date: Thu Sep 20 18:54:10 EDT 2012

Hello,

the documentation for the racket/stream module states that lists can be 
used as streams transparently and stream? returns #t when applied to a 
list. However, some of the functions operating on streams fail when 
applied to lists. For example:

   $ racket
   Welcome to Racket v5.3.
   -> (define l '(1 2 3))
   -> (stream? l)
   #t
   -> (stream-map add1 l)
   ; stream-accessor: contract violation
   ;   expected: stream?
   ;   given: '(1 2 3)
   ; [,bt for context]

Other functions that don't work with lists are stream-length, stream-ref, 
stream-tail, stream-append, stream-filter? and stream-add-between.

To me this looks like a bug :-(

Ciao,
Thomas


-- 
When C++ is your hammer, every problem looks like your thumb.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1600 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.racket-lang.org/users/archive/attachments/20120921/1d55e4ce/attachment.p7s>

Posted on the users mailing list.