Fuzion Logo
flang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

asStream

🌌array.asStream


redefines Sequence.asStream:
create a stream of T.

A stream contains mutable state, so it cannot be reused or shared
between threads.

Default implementation uses asList. Heirs must redefine at least
one of asList or asStream.

NYI: we create heap allocated instance of array explicitly, needed while
issue #30 is not fixed. Once issue is fixed, array.this can be used instead.
See idiom40ex.fz for a test case


redefines stream.hasNext:
does this stream have one more element?


redefines stream.next:
the next element in this stream