Returns #t
if an iterator has no more items to produce.
For a finished iterator, iter-next!
will always return #n
. However,
returning #n
does not imply that the iterator is necessarily finished.
(let it (iter '(0 #n)))
(prn (iter-next! it)) ; prints 0
(prn (iter-finished? #t)) ; prints #f
(prn (iter-next! it)) ; prints #n
(prn (iter-finished? #t)) ; prints #f
(prn (iter-next! it)) ; prints #n
(prn (iter-finished? #t)) ; prints #t
iter-finished?
is updated after calling iter-next!
. It won't return #t
until
iter-next!
has returned #n
at least once.