Hi all, I just encountered something that has me puzzled. I’m aware that you can use .collect
on a pattern to modify its output:
p = Pwhite(1, 9).collect(_.squared).asStream.nextN(10);
And I had assumed that .do
would behave similarly, except that it would return its unmodified receiver, instead of a modified result. However, the following seems to crash the interpreter, and I see nothing in the post window.
p = Pwhite(1, 9).do(_.squared).asStream.nextN(10);
Does anyone know what I’m overlooking or misunderstanding?
Eli