Hi all,

After reading the SRFI-40 (stream library) egg
documentation at

http://www.call-with-current-continuation.org/eggs/srfi-40.html

I thought that the implementation includes the srfi-45
fixes to avoid space leaks. However, the test program
below seems to take up an ever-increasing amount of
memory. What gives?

---

;; Compile with csc -O3 -R srfi-40 test.scm
;; You may need to install srfi-40:
;; chicken-setup srfi-40

(define stream-ref
  (lambda (s n)
    (let loop ((s s) (i 0))
      (if (= i n) (stream-car s)
          (loop (stream-cdr s) (+ i 1))))))

(define integers-from
  (lambda (n)
    (stream-cons n (integers-from (+ n 1)))))
(define integers (integers-from 0))

; (set-gc-report! #t)
(display
  (stream-ref
    (stream-filter even? integers) 5000000))
(newline)

-- Dan

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to