Thanks. But that is not what I’m trying to achieve.
Your code plays: 0, 2, 4, 6, 2, 4, 6, 2, 4, ....
What I’m aiming for is to play: [0,2], [0,4], [0,6], [0,2], [0,4], ...
Thread resurrection, only because this happens to look rather cool syntax-wise with my recent experiment/invention Pforai; it basically says "take the zero (as a stream of zeros) and pair each value/zero with every item from the [2, 4, 6] array. The combine/merging function [_,_] in this case is just “merging” by pariing into a 2-element array:
The array for Pforai can be a pattern or stream too, i.e the row can change after a full previous row is “done”. For immediate swap I have a Pforp variant
since there are many more methods defined than Psomethings, if you can find a method already defined that does what you want but isn’t “patternized” you can just the above technique. (Although in this case you do have Ptuple.) There’s an Event-based hack that allows one to use Pbinop with arbitrary functions as pseudo-operators, but it’s seldom worth it, when you can use Pcollect etc. which take functions as input.