I'll need to benchmark it to see if my (elegant?) referencing and shifting of the range result in a penalty. Readability (in the eye of the beholder) is my second goal.
I don't want to loop over iterators (yet), that's again another (third) semantic.
I need only nested loops, to make the interface intuitive for the users
for my $x ( $sub_x->() ) { for my $y ( $sub_y->() ) { return [ $x,$y ]; } }
From what I understand are you caching the values for the next iteration, this brakes my semantics and might cause side effects.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^4: Efficient but elegant Cross-Product iterator ? (updated)
by LanX
in thread Efficient but elegant Cross-Product iterator ?
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |