Check out this discussion:
I also don’t know if this is possible on Streams. At least it is possible on Patterns:
Pseq([0,1,2,3]).asStream.next // always 0, as Stream is always a copy
Prout{ (0..10).do(_.yield)}.asStream.next // same, embedding a custom routine function
The trick seems to be that .asStream actually creates a new stream.
One way to do it with routines would be to create a new routine from the same function, if we only had read access to its internal function (it’s a read-only variable).