You can write a sub to return the next step:sub bondigi { state $n=1; return (<Bon Digi Bon Digi>, <Bon> xx $n, <Digi> xx $n++); }
Nahh. That's too easy... It's not fun :-)
but I think an idiomatic Perl 6 solution would have a proper lazy Iterator.
Yes, that's more interesting. -- Cosimo