Pslide1 : Pslide


Like Pslide, except that the step and len arguments need not be constants. If you supply patterns or streams for these arguments, they will be evaluated once per segment so that step and len can be variable.


p = Pslide((1..10), inf, 3, 1, 0).asStream;

p.nextN(20);

[ 1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 6, 5, 6, 7, 6, 7, 8, 7, 8 ]


q = Pslide1((1..10), inf, Pwhite(2, 5, inf), Pwhite(1, 3, inf), 0).asStream;

q.nextN(20);

[ 1, 2, 3, 4, 5, 2, 3, 4, 5, 5, 6, 7, 8, 7, 8, 9, 10, 1, 2, 2 ]