Commits

Moritz Heidkamp committed 71a2174

Allow already realized lists to be returned from body

Comments (0)

Files changed (2)

               (begin
                 (lazy-seq-value-set! seq value)
                 value)
-              (loop ((lazy-seq-body value))))))))
+              (loop (or (lazy-seq-value value)
+                        ((lazy-seq-body value)))))))))
 
 (define (lazy-head seq)
   (car (realized-lazy-seq seq)))
   (test-assert (lazy-seq? seq))
   (test-assert (lazy-seq-realized? seq))
   (test '("foo" "bar") (lazy-seq->list seq))
-  (test-assert (lazy-null? (lazy-tail (lazy-tail seq)))))
+  (test-assert (lazy-null? (lazy-tail (lazy-tail seq))))
+  (test "ok" (lazy-head (lazy-seq (list->lazy-seq '("ok"))))))
 
 
 (test-group "lazy-map"