It sounds exactly like you want coroutines or continuations. This might be a good opportunity to play around with Coro, which includes Coro::Cont, an implementation of continuations by way of coroutines.
Other approaches might try recursion or threads.
After Compline,
Zaxo
In reply to Re: complex iterator needed
by Zaxo
in thread complex iterator needed
by japhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |