Commits

Moritz Heidkamp committed 71a2174

Allow already realized lists to be returned from body

  • Participants
  • Parent commits 1d4a34b

Comments (0)

Files changed (2)

File lazy-seq.scm

               (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)))

File tests/run.scm

   (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"