in reply to Doing "it" only once
Supposing there is a way to pause (pause) a loop, and continue it later (cont { ... }), it's easy:
For this to work, pause would only come into effect after the entire statement is evaluated. Alternatively, consider next :pause or pause :next.my macro do_something { ... } for (...) { pause, next if ...; do_something; } cont { do_something; }
Having things optimized with a simple hint I think would be trivial.
would automatically be split.for (...) { notagain, next if ...; ...; }
Still, I don't think it's a problem that needs fixing. If you want to fix it, it's probably simple enough to do it in a module.
I would like the pause/cont combo, though. For many purposes, because not everyone likes to think in iterators.
Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Doing "it" only once
by blazar (Canon) on Sep 22, 2005 at 10:57 UTC |