-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
So currently you can do:
def s = Stream.from x:1..3, y:1..3 map { x + y } filter { x != y }
assert s.take( 5 ).collect() == [ 3, 4, 3, 5, 4 ]
And to stop a stream you can do:
def s = Stream.from { x + y++ } filter { it < 5 ?: STOP } using x:1, y:1
assert s.take( 5 ).collect() == [ 2, 3, 4 ]
But I need to think whether it's worth adding some different constructs instead, something like:
def s = Stream.using x:1, y:1 map { x + y } update { x += 1 ; y += 3 } until { x >= 3 }
assert s.take( 5 ).collect() == [ 2, 6 ]
Anyone got any opinions before I arbitrarily make a decision?
Knowing me, you've got a good few weeks ;-)