[plt-scheme] SRFI 41

From: michael rice (nowgate at yahoo.com)
Date: Wed Oct 8 14:11:13 EDT 2008

There's a stream-member function given in SRFI 41 that doesn't seem to work as expected.

=================

(require srfi/41)

(define s1 (stream-cons 'a (stream-cons 'b stream-null)))

(define-stream (stream-member eql? obj strm)
  (stream-let loop ((strm strm))
    (cond ((stream-null? strm) #f)
          ((eql? obj (stream-car strm)) strm)
          (else (loop (stream-cdr strm))))))

===================

Welcome to DrScheme, version 4.1 [3m].
Language: Swindle; memory limit: 128 megabytes.
> (stream-member equal? 'c s1)
#<stream>
> 

===================

Shouldn't the answer be #f?

Michael



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20081008/180c8ece/attachment.html>

Posted on the users mailing list.